From: Ingo Ruhnke Date: Fri, 20 Feb 2004 19:45:05 +0000 (+0000) Subject: - replaced d_type with a stat() call (the former doesn't work with reiserfs) X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=3a2e445f4a00e2989c8e7915f315c1e2dd16f24d;p=supertux.git - replaced d_type with a stat() call (the former doesn't work with reiserfs) SVN-Revision: 135 --- diff --git a/src/setup.c b/src/setup.c index 91b218958..d2da0b44b 100644 --- a/src/setup.c +++ b/src/setup.c @@ -95,7 +95,7 @@ char ** dsubdirs(char *rel_path, char* expected_file, int* num) struct dirent *direntp; int i = 0; char ** sdirs= NULL; - char filename[100]; + char filename[1024]; char path[1024]; sprintf(path,"%s/%s",st_dir,rel_path); @@ -103,7 +103,12 @@ char ** dsubdirs(char *rel_path, char* expected_file, int* num) { while((direntp = readdir(dirStructP)) != NULL) { - if ( direntp->d_type == DT_DIR ) + char absolute_filename[1024]; + struct stat buf; + + sprintf(absolute_filename, "%s/%s", path, direntp->d_name); + + if (stat(absolute_filename, &buf) == 0 && S_ISDIR(buf.st_mode)) { if(expected_file != NULL) { @@ -126,7 +131,12 @@ char ** dsubdirs(char *rel_path, char* expected_file, int* num) { while((direntp = readdir(dirStructP)) != NULL) { - if ( direntp->d_type == DT_DIR ) + char absolute_filename[1024]; + struct stat buf; + + sprintf(absolute_filename, "%s/%s", path, direntp->d_name); + + if (stat(absolute_filename, &buf) == 0 && S_ISDIR(buf.st_mode)) { if(expected_file != NULL) {