From 8389922de9c5747f0fa5948ecfcefbd6c83cf97c Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 3 Nov 2011 22:05:38 +0100 Subject: [PATCH] filechooserentry: Don't trim away the slash after directories It's not necessary as the code appending the slashes checks for a slash these days. --- gtk/gtkfilechooserentry.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c index 4093bdc1a8..c90872cbbd 100644 --- a/gtk/gtkfilechooserentry.c +++ b/gtk/gtkfilechooserentry.c @@ -484,18 +484,6 @@ maybe_append_separator_to_file (GtkFileChooserEntry *chooser_entry, return display_name; } -static char * -trim_dir_separator_suffix (const char *str) -{ - int len; - - len = strlen (str); - if (len > 0 && G_IS_DIR_SEPARATOR (str[len - 1])) - return g_strndup (str, len - 1); - else - return g_strdup (str); -} - /* Determines if the completion model has entries with a common prefix relative * to the current contents of the entry. Also, if there's one and only one such * path, stores it in unique_path_ret. @@ -562,7 +550,7 @@ find_common_prefix (GtkFileChooserEntry *chooser_entry, { if (!*common_prefix_ret) { - *common_prefix_ret = trim_dir_separator_suffix (display_name); + *common_prefix_ret = g_strdup (display_name); *unique_file_ret = g_object_ref (file); } else