# HG changeset patch # User zas_ # Date 1236339745 0 # Node ID 31a747f9d26804ceb86b2c78c2b2d352e36a4060 # Parent 94eb664a7da1f57137bf7637da658daff42f7737 Fix tab completion when entering "/et[TAB]" it was changed to "et", this is fixed. diff -r 94eb664a7da1 -r 31a747f9d268 src/ui_tabcomp.c --- 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);