From 05df239ed90584156b820dbf3ede638208eb440f Mon Sep 17 00:00:00 2001 From: Erik Andersen Date: Thu, 13 Jan 2000 04:43:48 +0000 Subject: Bug fixes. -Erik --- utility.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'utility.c') diff --git a/utility.c b/utility.c index c1bd82e8b..c18cb4b27 100644 --- a/utility.c +++ b/utility.c @@ -396,7 +396,7 @@ recursiveAction(const char *fileName, int recurse, int followLinks, int depthFir int (*dirAction) (const char *fileName, struct stat* statbuf)) { int status; - struct stat statbuf; + struct stat statbuf, statbuf1; struct dirent *next; if (followLinks == TRUE) @@ -404,6 +404,7 @@ recursiveAction(const char *fileName, int recurse, int followLinks, int depthFir else status = lstat(fileName, &statbuf); + status = lstat(fileName, &statbuf); if (status < 0) { perror(fileName); return (FALSE); @@ -424,8 +425,14 @@ recursiveAction(const char *fileName, int recurse, int followLinks, int depthFir return (TRUE); } } + + status = lstat(fileName, &statbuf1); + if (status < 0) { + perror(fileName); + return (FALSE); + } - if (S_ISDIR(statbuf.st_mode)) { + if (S_ISDIR(statbuf.st_mode) && S_ISDIR(statbuf1.st_mode)) { DIR *dir; dir = opendir(fileName); if (!dir) { -- cgit v1.2.3