changeset 1370:0011d6859ec5

Add a directory separator at the end of names in tab completion list to indicate directories.
author zas_
date Mon, 02 Mar 2009 21:04:38 +0000
parents dc1768a8af01
children 2c2f86e30f6c
files src/ui_tabcomp.c
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ui_tabcomp.c	Sun Mar 01 23:38:36 2009 +0000
+++ b/src/ui_tabcomp.c	Mon Mar 02 21:04:38 2009 +0000
@@ -124,7 +124,18 @@
 		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);