Explorar o código

Fixed GRP_enumerateFiles() so that it will only list files in the root of
the readable file tree.

Ryan C. Gordon %!s(int64=25) %!d(string=hai) anos
pai
achega
fe77666054
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      archivers/grp.c

+ 3 - 0
archivers/grp.c

@@ -207,6 +207,9 @@ static LinkedStringList *GRP_enumerateFiles(DirHandle *h, const char *dirname)
     LinkedStringList *l = NULL;
     LinkedStringList *l = NULL;
     LinkedStringList *prev = NULL;
     LinkedStringList *prev = NULL;
 
 
+    if (*dirname != '\0')   /* no directories in GRP files. */
+        return(NULL);
+
         /* jump to first file entry... */
         /* jump to first file entry... */
     errno = 0;
     errno = 0;
     BAIL_IF_MACRO(fseek(fh, 16, SEEK_SET) == -1, strerror(errno), NULL);
     BAIL_IF_MACRO(fseek(fh, 16, SEEK_SET) == -1, strerror(errno), NULL);