# HG changeset patch # User zas_ # Date 1236351212 0 # Node ID b4e6fee484f70f3f0ac9716d98f9aafdd466cf4c # Parent 99eae1622e0c26c271e6b35304aeeb87c64fbdd6 Fix utf8/locale conversion warning: the path passed to isdir() is not in UTF8 (if local fs is not in UFT8) so do not use it (isdir() uses stat_utf8() which calls path_from_utf8()). diff -r 99eae1622e0c -r b4e6fee484f7 src/ui_tabcomp.c --- a/src/ui_tabcomp.c Fri Mar 06 14:42:32 2009 +0000 +++ b/src/ui_tabcomp.c Fri Mar 06 14:53:32 2009 +0000 @@ -113,10 +113,10 @@ pathl = path_from_utf8(path); dp = opendir(pathl); - g_free(pathl); if (!dp) { /* dir not found */ + g_free(pathl); return; } while ((dir = readdir(dp)) != NULL) @@ -124,9 +124,9 @@ gchar *name = dir->d_name; if (strcmp(name, ".") != 0 && strcmp(name, "..") != 0) { - gchar *abspath = g_build_filename(path, name, NULL); + gchar *abspath = g_build_filename(pathl, name, NULL); - if (isdir(abspath)) + if (g_file_test(abspath, G_FILE_TEST_IS_DIR)) { gchar *dname = g_strconcat(name, G_DIR_SEPARATOR_S, NULL); list = g_list_prepend(list, path_to_utf8(dname)); @@ -143,6 +143,7 @@ td->dir_path = g_strdup(path); td->file_list = list; + g_free(pathl); } static void tab_completion_destroy(GtkWidget *widget, gpointer data)