bug fixes for pixmap theming: removed use of scandir
authorCarsten Schurig <Carsten.Schurig@web.de>
Thu, 14 Feb 2002 19:12:54 +0000 (19:12 +0000)
committerCarsten Schurig <Carsten.Schurig@web.de>
Thu, 14 Feb 2002 19:12:54 +0000 (19:12 +0000)
ChangeLog.claws
configure.in
src/stock_pixmap.c

index fa48b2bb894a13a163507adef57e88a04c620d37..86918a0f7e219aaf03505d7246bfd6e755fa79ca 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-14 [carsten]   0.7.1.claws2
+       * src/stock_pixmap.c
+               used opendir/readdir/closedir instead of scandir
+               -> code should work now on Solaris
+
 2002-02-14 [paul]      0.7.1claws1
 
        * sync with sylpheed 0.7.1cvs8
index 40a1e42dacfc8a8ec6e58a3b3eaac46a21065ef9..2f450fd5e4aa437284ca38b913ff2206edfed247 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws1
+EXTRA_VERSION=claws2
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 126fbac448d397a66d258bc0dbbab56915eae9ca..7da7a727a0779b20dfb85cb280aba194a240af96 100644 (file)
@@ -243,17 +243,19 @@ gint stock_pixmap_gdk(GtkWidget *window, StockPixmap icon,
 
 static void stock_pixmap_find_themes_in_dir(GList **list, const gchar *dirname)
 {
-       struct dirent **namelist;
-       int n;
-
-       if ((n = scandir(dirname, &namelist, 0, alphasort)) <= 0)
+       struct dirent *d;
+       DIR *dp;
+       
+       if ((dp = opendir(dirname)) == NULL) {
+               FILE_OP_ERROR(dirname, "opendir");
                return;
-
-       while (n--) {
+       }
+       
+       while ((d = readdir(dp)) != NULL) {
                gchar *entry;
                gchar *fullentry;
 
-               entry     = namelist[n]->d_name;
+               entry     = d->d_name;
                fullentry = g_strconcat(dirname, G_DIR_SEPARATOR_S, entry, NULL);
                
                if (strcmp(entry, ".") != 0 && strcmp(entry, "..") != 0 && is_dir_exist(fullentry)) {
@@ -271,9 +273,8 @@ static void stock_pixmap_find_themes_in_dir(GList **list, const gchar *dirname)
                        if (i == N_STOCK_PIXMAPS) 
                                g_free(fullentry);
                }
-               g_free(namelist[n]);
        }
-       g_free(namelist);
+       closedir(dp);
 }
 
 GList *stock_pixmap_themes_list_new(void)