Add a directory separator at the end of names in tab completion list to indicate...
authorLaurent Monin <geeqie@norz.org>
Mon, 2 Mar 2009 21:04:38 +0000 (21:04 +0000)
committerLaurent Monin <geeqie@norz.org>
Mon, 2 Mar 2009 21:04:38 +0000 (21:04 +0000)
src/ui_tabcomp.c

index 231c2ad..a3da8de 100644 (file)
@@ -124,7 +124,18 @@ static void tab_completion_read_dir(TabCompData *td, const gchar *path)
                gchar *name = dir->d_name;
                if (strcmp(name, ".") != 0 && strcmp(name, "..") != 0)
                        {
-                       list = g_list_prepend(list, path_to_utf8(name));
+                       gchar *abspath = g_build_filename(path, name, NULL);
+
+                       if (isdir(abspath))
+                               {
+                               gchar *dname = g_strconcat(name, G_DIR_SEPARATOR_S, NULL);
+                               list = g_list_prepend(list, path_to_utf8(dname));
+                               }
+                       else
+                               {
+                               list = g_list_prepend(list, path_to_utf8(name));
+                               }
+                       g_free(abspath);
                        }
                }
        closedir(dp);