Fri Oct 13 10:27:22 2006 John Ellis <johne@verizon.net>
authorJohn Ellis <johne@verizon.net>
Fri, 13 Oct 2006 14:36:26 +0000 (14:36 +0000)
committerJohn Ellis <johne@verizon.net>
Fri, 13 Oct 2006 14:36:26 +0000 (14:36 +0000)
        * cache_maint.c, ui_fileops.c, ui_pathsel.c, ui_tabcomp.c: Remove use
        of the d_ino > 0 test as all files listed by readdir should be valid.
        dirent.d_ino is not guanteed by POSIX, and at one recent point is
        not implemented on cygwin.

ChangeLog
src/cache_maint.c
src/ui_fileops.c
src/ui_pathsel.c
src/ui_tabcomp.c

index c56c5df..a96cac7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri Oct 13 10:27:22 2006  John Ellis  <johne@verizon.net>
+
+       * cache_maint.c, ui_fileops.c, ui_pathsel.c, ui_tabcomp.c: Remove use
+       of the d_ino > 0 test as all files listed by readdir should be valid.
+       dirent.d_ino is not guanteed by POSIX, and at one recent point is
+       not implemented on cygwin.
+
 Fri Oct 13 09:25:25 2006  John Ellis  <johne@verizon.net>
 
        * pl.po: Update Polish translation,
index 9d4c481..8a3d387 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * GQview
- * (C) 2004 John Ellis
+ * (C) 2006 John Ellis
  *
  * Author: John Ellis
  *
@@ -95,8 +95,7 @@ static gint isempty(const gchar *path)
                {
                gchar *name = dir->d_name;
 
-               if (dir->d_ino > 0 &&
-                   !(name[0] == '.' && (name[1] == '\0' || (name[1] == '.' && name[2] == '\0'))) )
+               if (!(name[0] == '.' && (name[1] == '\0' || (name[1] == '.' && name[2] == '\0'))) )
                        {
                        closedir(dp);
                        return FALSE;
index 916e571..e0db392 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * (SLIK) SimpLIstic sKin functions
- * (C) 2004 John Ellis
+ * (C) 2006 John Ellis
  *
  * Author: John Ellis
  *
@@ -533,36 +533,35 @@ gint path_list(const gchar *path, GList **files, GList **dirs)
 
        while ((dir = readdir(dp)) != NULL)
                {
-               /* skip removed files */
-               if (dir->d_ino > 0)
+               gchar *name = dir->d_name;
+               gchar *filepath = g_strconcat(pathl, "/", name, NULL);
+
+               if (stat(filepath, &ent_sbuf) >= 0)
                        {
-                       gchar *name = dir->d_name;
-                       gchar *filepath = g_strconcat(pathl, "/", name, NULL);
-                       if (stat(filepath, &ent_sbuf) >= 0)
+                       gchar *path8;
+                       gchar *name8;
+
+                       name8 = path_to_utf8(name);
+                       path8 = g_strconcat(path, "/", name8, NULL);
+                       g_free(name8);
+
+                       if (dirs && S_ISDIR(ent_sbuf.st_mode) &&
+                           !(name[0] == '.' && (name[1] == '\0' || (name[1] == '.' && name[2] == '\0'))) )
                                {
-                               gchar *path8;
-                               gchar *name8;
-
-                               name8 = path_to_utf8(name);
-                               path8 = g_strconcat(path, "/", name8, NULL);
-                               g_free(name8);
-
-                               if (dirs && S_ISDIR(ent_sbuf.st_mode) &&
-                                   !(name[0] == '.' && (name[1] == '\0' || (name[1] == '.' && name[2] == '\0'))) )
-                                       {
-                                       d_list = g_list_prepend(d_list, path8);
-                                       path8 = NULL;
-                                               }
-                                       else if (files && S_ISREG(ent_sbuf.st_mode))
-                                       {
-                                       f_list = g_list_prepend(f_list, path8);
-                                       path8 = NULL;
-                                       }
-                               g_free(path8);
+                               d_list = g_list_prepend(d_list, path8);
+                               path8 = NULL;
                                }
-                       g_free(filepath);
+                       else if (files && S_ISREG(ent_sbuf.st_mode))
+                               {
+                               f_list = g_list_prepend(f_list, path8);
+                               path8 = NULL;
+                               }
+                       g_free(path8);
                        }
+
+               g_free(filepath);
                }
+
        closedir(dp);
 
        g_free(pathl);
index 562d834..2aaaced 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * (SLIK) SimpLIstic sKin functions
- * (C) 2004 John Ellis
+ * (C) 2006 John Ellis
  *
  * Author: John Ellis
  *
@@ -177,8 +177,7 @@ static void dest_populate(Dest_Data *dd, const gchar *path)
                }
        while ((dir = readdir(dp)) != NULL)
                {
-               /* skips removed files */
-               if (dir->d_ino > 0 && (dd->show_hidden || !is_hidden(dir->d_name)) )
+               if (dd->show_hidden || !is_hidden(dir->d_name))
                        {
                        gchar *name = dir->d_name;
                        gchar *filepath = g_strconcat(pathl, "/", name, NULL);
index 0eb1484..399e2ed 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * (SLIK) SimpLIstic sKin functions
- * (C) 2004 John Ellis
+ * (C) 2006 John Ellis
  *
  * Author: John Ellis
  *
@@ -115,15 +115,11 @@ static void tab_completion_read_dir(TabCompData *td, const gchar *path)
                 }
         while ((dir = readdir(dp)) != NULL)
                 {
-                /* skips removed files */
-                if (dir->d_ino > 0)
-                        {
-                       gchar *name = dir->d_name;
-                       if (strcmp(name, ".") != 0 && strcmp(name, "..") != 0)
-                               {
-                               list = g_list_prepend(list, path_to_utf8(name));
-                               }
-                        }
+               gchar *name = dir->d_name;
+               if (strcmp(name, ".") != 0 && strcmp(name, "..") != 0)
+                       {
+                       list = g_list_prepend(list, path_to_utf8(name));
+                       }
                }
         closedir(dp);