- fold recurse, depthFirst and dereference params into one param flags.

Minor size improvement (-16b for size, -24b according to bloat-o-meter).
This commit is contained in:
Bernhard Reutner-Fischer
2007-03-29 10:30:50 +00:00
parent 3d43edb28c
commit 3e816c1252
11 changed files with 50 additions and 55 deletions

View File

@@ -101,8 +101,6 @@ int chmod_main(int argc, char **argv)
do {
if (!recursive_action(*argv,
OPT_RECURSE, // recurse
FALSE, // follow links: coreutils doesn't
FALSE, // depth first
fileAction, // file action
fileAction, // dir action
smode, // user data

View File

@@ -92,13 +92,12 @@ int chown_main(int argc, char **argv)
}
if (!recursive_action(arg,
OPT_RECURSE, // recurse
OPT_TRAVERSE, // follow links if -L
FALSE, // depth first
fileAction, // file action
fileAction, // dir action
chown_func, // user data
0) // depth
(OPT_RECURSE ? action_recurse : 0 | /* recurse */
OPT_TRAVERSE ? action_followLinks : 0),/* follow links if -L */
fileAction, /* file action */
fileAction, /* dir action */
chown_func, /* user data */
0) /* depth */
) {
retval = EXIT_FAILURE;
}

View File

@@ -1079,7 +1079,8 @@ static char **get_dir(char *path)
* add_to_dirlist then removes root dir prefix. */
if (option_mask32 & FLAG_r) {
recursive_action(path, TRUE, TRUE, FALSE, add_to_dirlist, NULL,
recursive_action(path, action_recurse|action_followLinks,
add_to_dirlist, NULL,
(void*)(strlen(path)+1), 0);
} else {
DIR *dp;