changeset 1382:31a747f9d268

Fix tab completion when entering "/et[TAB]" it was changed to "et", this is fixed.
author zas_
date Fri, 06 Mar 2009 11:42:25 +0000
parents 94eb664a7da1
children 3c9abbc05792
files src/ui_tabcomp.c
diffstat 1 files changed, 3 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/ui_tabcomp.c	Thu Mar 05 23:32:56 2009 +0000
+++ b/src/ui_tabcomp.c	Fri Mar 06 11:42:25 2009 +0000
@@ -386,8 +386,6 @@
 		entry_dir = g_strdup(entry_text);
 		}
 
-	entry_file = filename_from_path(entry_text);
-
 	if (isfile(entry_dir))
 		{
 		if (home_exp)
@@ -399,6 +397,8 @@
 		return home_exp;
 		}
 
+	entry_file = filename_from_path(entry_text);
+
 	if (isdir(entry_dir) && strcmp(entry_file, ".") != 0 && strcmp(entry_file, "..") != 0)
 		{
 		ptr = entry_dir + strlen(entry_dir) - 1;
@@ -455,7 +455,7 @@
 	ptr = (gchar *)filename_from_path(entry_dir);
 	if (ptr > entry_dir) ptr--;
 	ptr[0] = '\0';
-
+	
 	if (strlen(entry_dir) == 0)
 		{
 		g_free(entry_dir);
@@ -473,8 +473,6 @@
 			tab_completion_read_dir(td, entry_dir);
 			}
 
-		if (strcmp(entry_dir, G_DIR_SEPARATOR_S) == 0) entry_dir[0] = '\0'; /* FIXME: win32 */
-
 		list = td->file_list;
 		while (list)
 			{
@@ -494,13 +492,6 @@
 				gchar *buf;
 
 				buf = g_build_filename(entry_dir, file, NULL);
-
-				if (isdir(buf))
-					{
-					gchar *tmp = g_strconcat(buf, G_DIR_SEPARATOR_S, NULL);
-					g_free(buf);
-					buf = tmp;
-					}
 				gtk_entry_set_text(GTK_ENTRY(td->entry), buf);
 				gtk_editable_set_position(GTK_EDITABLE(td->entry), strlen(buf));
 				g_free(buf);