[PATCH 06/19] whereis: fix shadow declaration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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]

Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 misc-utils/whereis.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/misc-utils/whereis.c b/misc-utils/whereis.c
index 6807b8a..6faf262 100644
--- a/misc-utils/whereis.c
+++ b/misc-utils/whereis.c
@@ -188,7 +188,7 @@ itsit(char *cp, char *dp)
 static void
 findin(char *dir, char *cp)
 {
-	DIR *dirp;
+	DIR *derp;
 	struct dirent *dp;
 	char *d, *dd;
 	size_t l;
@@ -197,17 +197,17 @@ findin(char *dir, char *cp)
 
 	dd = strchr(dir, '*');
 	if (!dd) {
-		dirp = opendir(dir);
-		if (dirp == NULL)
+		derp = opendir(dir);
+		if (derp == NULL)
 			return;
-		while ((dp = readdir(dirp)) != NULL) {
+		while ((dp = readdir(derp)) != NULL) {
 			if (itsit(cp, dp->d_name)) {
 				count++;
 				if (print)
 					printf(" %s/%s", dir, dp->d_name);
 			}
 		}
-		closedir(dirp);
+		closedir(derp);
 		return;
 	}
 
@@ -217,10 +217,10 @@ findin(char *dir, char *cp)
 		strcpy(dirbuf, dir);
 		d = strchr(dirbuf, '*');
 		*d = 0;
-		dirp = opendir(dirbuf);
-		if (dirp == NULL)
+		derp = opendir(dirbuf);
+		if (derp == NULL)
 			return;
-		while ((dp = readdir(dirp)) != NULL) {
+		while ((dp = readdir(derp)) != NULL) {
 			if (!strcmp(dp->d_name, ".") ||
 			    !strcmp(dp->d_name, ".."))
 				continue;
@@ -234,7 +234,7 @@ findin(char *dir, char *cp)
 			strcat(d, dd + 1);
 			findin(dirbuf, cp);
 		}
-		closedir(dirp);
+		closedir(derp);
 	}
 	return;
 
-- 
1.7.11.3

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux