diff options
author | Erik Andersen | 2000-01-13 04:43:48 +0000 |
---|---|---|
committer | Erik Andersen | 2000-01-13 04:43:48 +0000 |
commit | 05df239ed90584156b820dbf3ede638208eb440f (patch) | |
tree | 990a3d6a9beb21420fae1f7d14886c84a5ce3c12 /utility.c | |
parent | 9a9a261569df0c88038de48eb233890ca189e9c0 (diff) | |
download | busybox-05df239ed90584156b820dbf3ede638208eb440f.zip busybox-05df239ed90584156b820dbf3ede638208eb440f.tar.gz |
Bug fixes.
-Erik
Diffstat (limited to 'utility.c')
-rw-r--r-- | utility.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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) { |