From 4e6e520fd4e9837ebe7ff72638dc13a0274fb855 Mon Sep 17 00:00:00 2001 From: Andy Hertzfeld Date: Tue, 20 Feb 2001 23:30:41 +0000 Subject: fixed bug 6717, problem editing a uri with a '#' in the middle, by adding * src/nautilus-location-bar.c: (try_to_expand_path): fixed bug 6717, problem editing a uri with a '#' in the middle, by adding a check to the auto-complete code to not substitute zero length strings. --- src/nautilus-location-bar.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') 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); -- cgit v1.2.1