summaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
authorMatt Kraai2000-12-19 06:24:08 +0000
committerMatt Kraai2000-12-19 06:24:08 +0000
commita1f977598138ebf8f5f1672daa936255cf3affc1 (patch)
treea655709eabc453ddd518c8d0090c3b7cd2ef8219 /utility.c
parent24ac0179617e43ab517141fe5497f4ebac108678 (diff)
downloadbusybox-a1f977598138ebf8f5f1672daa936255cf3affc1.zip
busybox-a1f977598138ebf8f5f1672daa936255cf3affc1.tar.gz
Fix tar handling of absolute paths and excluded directories.
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/utility.c b/utility.c
index 34341c8..b06abf4 100644
--- a/utility.c
+++ b/utility.c
@@ -663,17 +663,18 @@ int recursive_action(const char *fileName,
if (S_ISDIR(statbuf.st_mode)) {
DIR *dir;
- dir = opendir(fileName);
- if (!dir) {
- perror_msg("%s", fileName);
- return FALSE;
- }
if (dirAction != NULL && depthFirst == FALSE) {
status = dirAction(fileName, &statbuf, userData);
if (status == FALSE) {
perror_msg("%s", fileName);
return FALSE;
- }
+ } else if (status == SKIP)
+ return TRUE;
+ }
+ dir = opendir(fileName);
+ if (!dir) {
+ perror_msg("%s", fileName);
+ return FALSE;
}
while ((next = readdir(dir)) != NULL) {
char nextFile[BUFSIZ + 1];