From a1f977598138ebf8f5f1672daa936255cf3affc1 Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Tue, 19 Dec 2000 06:24:08 +0000 Subject: Fix tar handling of absolute paths and excluded directories. --- utility.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'utility.c') 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]; -- cgit v1.1