summaryrefslogtreecommitdiff
path: root/src/nautilus-location-bar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nautilus-location-bar.c')
-rw-r--r--src/nautilus-location-bar.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nautilus-location-bar.c b/src/nautilus-location-bar.c
index 09dad1e6c..1212d45ec 100644
--- a/src/nautilus-location-bar.c
+++ b/src/nautilus-location-bar.c
@@ -296,7 +296,7 @@ try_to_expand_path (NautilusLocationBar *bar)
GnomeVFSURI *uri;
GtkEditable *editable;
- int base_length;
+ uint base_length;
int current_path_length;
int offset;
const char *base_name_ptr;
@@ -374,8 +374,9 @@ try_to_expand_path (NautilusLocationBar *bar)
}
/* if we've got something, add it to the entry */
- if (expand_text && !nautilus_str_has_suffix (current_path, expand_text)) {
- gtk_entry_append_text (GTK_ENTRY (editable), expand_text + base_length);
+ if (expand_text && !nautilus_str_has_suffix (current_path, expand_text)
+ && base_length < strlen (expand_text)) {
+ gtk_entry_append_text (GTK_ENTRY (editable), expand_text + base_length);
gtk_entry_select_region (GTK_ENTRY (editable), current_path_length - offset,
current_path_length + strlen (expand_text) - base_length - offset);
g_free (expand_text);