[gtk+/gtk-2-24] filechooserentry: Don't trim away the slash after directories



commit 29d7464922996ace60d167d0d4b482ea2cfba5c0
Author: Benjamin Otte <otte redhat com>
Date:   Thu Nov 3 22:05:38 2011 +0100

    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 files changed, 1 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c
index 4a35296..93692b5 100644
--- a/gtk/gtkfilechooserentry.c
+++ b/gtk/gtkfilechooserentry.c
@@ -491,18 +491,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.
@@ -569,7 +557,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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]