Use ListBox in stead of ComboBox in Match-Options dialog
[xboard.git] / filebrowser / dir.c
index 918d555..ff317e5 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <stdio.h>
 #include <stdlib.h> /* for qsort */
-#include "../config.h" /* to check for dirent.h */
+#include "config.h" /* to check for dirent.h */
 
 #ifdef SEL_FILE_IGNORE_CASE
 #include <ctype.h>
@@ -121,14 +121,13 @@ SFgetDir(dir)
        (void) stat(".", &statBuf);
        dir->mtime = statBuf.st_mtime;
 
-       (void) readdir(dirp);   /* throw away "." */
+       while (dp = readdir(dirp)) {
 
+               struct stat statBuf;
+               if(!strcmp(dp->d_name, ".")) continue; /* Throw away "." */
+               if(!strcmp(dp->d_name, "..")) continue; /* Throw away ".." */
 #ifndef S_IFLNK
-       (void) readdir(dirp);   /* throw away ".." */
 #endif /* ndef S_IFLNK */
-
-       while (dp = readdir(dirp)) {
-               struct stat statBuf;
                if (i >= alloc) {
                        alloc = 2 * (alloc + 1);
                        result = (SFEntry *) XtRealloc((char *) result,