]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
whereis: fix shadow declaration
authorKarel Zak <kzak@redhat.com>
Wed, 25 Jul 2012 19:15:27 +0000 (21:15 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 26 Jul 2012 11:27:06 +0000 (13:27 +0200)
misc-utils/whereis.c:191:7: warning: declaration of 'dirp' shadows a global declaration [-Wshadow]
misc-utils/whereis.c:134:42: warning: shadowed declaration is here [-Wshadow]

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/whereis.c

index 6807b8a6880885e5045459b328cc4a48b44c7b06..05af8e0b821abc0db5a35e111873193138b3a298 100644 (file)
@@ -131,7 +131,7 @@ static char *srcdirs[] = {
 };
 
 static char sflag = 1, bflag = 1, mflag = 1, uflag;
-static char **Sflag, **Bflag, **Mflag, **dirp, **pathdir;
+static char **Sflag, **Bflag, **Mflag, **pathdir, **pathdir_p;
 static int Scnt, Bcnt, Mcnt, count, print;
 
 static void __attribute__ ((__noreturn__)) usage(FILE * out)
@@ -283,7 +283,7 @@ static void fillpath(void)
        pathdir = xrealloc(pathdir, (i + 1) * sizeof(char *));
        pathdir[i] = NULL;
 
-       dirp = pathdir;
+       pathdir_p = pathdir;
        free(pathcp);
 }
 
@@ -314,8 +314,8 @@ lookbin(char *cp)
 {
        if (Bflag == 0) {
                findv(bindirs, ARRAY_SIZE(bindirs)-1, cp);
-               while (*dirp)
-                       findin(*dirp++, cp);            /* look $PATH */
+               while (*pathdir_p)
+                       findin(*pathdir_p++, cp);               /* look $PATH */
         } else
                findv(Bflag, Bcnt, cp);
 }