Bug fixes.
-Erik
diff --git a/utility.c b/utility.c
index c1bd82e..c18cb4b 100644
--- a/utility.c
+++ b/utility.c
@@ -396,7 +396,7 @@
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 @@
else
status = lstat(fileName, &statbuf);
+ status = lstat(fileName, &statbuf);
if (status < 0) {
perror(fileName);
return (FALSE);
@@ -424,8 +425,14 @@
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) {