]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(glob): Pass alternate file access functions also in recursive call.
authorUlrich Drepper <drepper@redhat.com>
Wed, 29 Dec 1999 03:03:12 +0000 (03:03 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 29 Dec 1999 03:03:12 +0000 (03:03 +0000)
sysdeps/generic/glob.c

index 9b134c5a0dddd1c7f70a5cfd5f21b8667d2780fa..9a57230e773d346854a6a537891cc53550bcd57f 100644 (file)
@@ -841,8 +841,20 @@ glob (pattern, flags, errfunc, pglob)
       glob_t dirs;
       register int i;
 
+      if ((flags & GLOB_ALTDIRFUNC) != 0)
+       {
+         /* Use the alternative access functions also in the recursive
+            call.  */
+         dirs.gl_opendir = pglob->gl_opendir;
+         dirs.gl_readdir = pglob->gl_readdir;
+         dirs.gl_closedir = pglob->gl_closedir;
+         dirs.gl_stat = pglob->gl_stat;
+         dirs.gl_lstat = pglob->gl_lstat;
+       }
+
       status = glob (dirname,
-                    ((flags & (GLOB_ERR | GLOB_NOCHECK | GLOB_NOESCAPE))
+                    ((flags & (GLOB_ERR | GLOB_NOCHECK | GLOB_NOESCAPE
+                               | GLOB_ALTDIRFUNC))
                      | GLOB_NOSORT | GLOB_ONLYDIR),
                     errfunc, &dirs);
       if (status != 0)