From: Karel Zak Date: Wed, 25 Jul 2012 19:15:27 +0000 (+0200) Subject: whereis: fix shadow declaration X-Git-Tag: v2.22-rc1~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=af842d142ee334bf4851329eda48ca69f8bfe0d9;p=thirdparty%2Futil-linux.git whereis: fix shadow declaration 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 Signed-off-by: Karel Zak --- diff --git a/misc-utils/whereis.c b/misc-utils/whereis.c index 6807b8a688..05af8e0b82 100644 --- a/misc-utils/whereis.c +++ b/misc-utils/whereis.c @@ -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); }