diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-08 14:52:28 +0400 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-08 14:52:28 +0400 |
commit | bbd695d8010ab453a5a89ba6d7ebfe1a96b87b7d (patch) | |
tree | 98df39594da2e7f1fbe560aec04eeb09426947f0 /libbb/recursive_action.c | |
parent | ca3484103e6b99d0c433988f2f809840d780d88b (diff) |
find: fix handling of -prune
recursive_actions: uppercase flag constants
Diffstat (limited to 'libbb/recursive_action.c')
-rw-r--r-- | libbb/recursive_action.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libbb/recursive_action.c b/libbb/recursive_action.c index 0c0531575..be2a700f5 100644 --- a/libbb/recursive_action.c +++ b/libbb/recursive_action.c @@ -55,12 +55,12 @@ int recursive_action(const char *fileName, if (!fileAction) fileAction = true_action; if (!dirAction) dirAction = true_action; - status = (flags & action_followLinks ? stat : lstat)(fileName, &statbuf); + status = (flags & ACTION_FOLLOWLINKS ? stat : lstat)(fileName, &statbuf); if (status < 0) { #ifdef DEBUG_RECURS_ACTION bb_error_msg("status=%d followLinks=%d TRUE=%d", - status, flags & action_followLinks, TRUE); + status, flags & ACTION_FOLLOWLINKS, TRUE); #endif goto done_nak_warn; } @@ -68,7 +68,7 @@ int recursive_action(const char *fileName, /* If S_ISLNK(m), then we know that !S_ISDIR(m). * Then we can skip checking first part: if it is true, then * (!dir) is also true! */ - if ( /* (!(flags & action_followLinks) && S_ISLNK(statbuf.st_mode)) || */ + if ( /* (!(flags & ACTION_FOLLOWLINKS) && S_ISLNK(statbuf.st_mode)) || */ !S_ISDIR(statbuf.st_mode) ) { return fileAction(fileName, &statbuf, userData, depth); @@ -76,11 +76,11 @@ int recursive_action(const char *fileName, /* It's a directory (or a link to one, and followLinks is set) */ - if (!(flags & action_recurse)) { + if (!(flags & ACTION_RECURSE)) { return dirAction(fileName, &statbuf, userData, depth); } - if (!(flags & action_depthFirst)) { + if (!(flags & ACTION_DEPTHFIRST)) { status = dirAction(fileName, &statbuf, userData, depth); if (!status) { goto done_nak_warn; @@ -104,14 +104,14 @@ int recursive_action(const char *fileName, if (nextFile == NULL) continue; /* now descend into it, forcing recursion. */ - if (!recursive_action(nextFile, flags | action_recurse, + if (!recursive_action(nextFile, flags | ACTION_RECURSE, fileAction, dirAction, userData, depth+1)) { status = FALSE; } free(nextFile); } closedir(dir); - if (flags & action_depthFirst && + if ((flags & ACTION_DEPTHFIRST) && !dirAction(fileName, &statbuf, userData, depth)) { goto done_nak_warn; } |