From 3e816c1252cc55e3763f946622129d31ea1f0f20 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 29 Mar 2007 10:30:50 +0000 Subject: - fold recurse, depthFirst and dereference params into one param flags. Minor size improvement (-16b for size, -24b according to bloat-o-meter). --- coreutils/chmod.c | 2 -- coreutils/chown.c | 13 ++++++------- coreutils/diff.c | 3 ++- 3 files changed, 8 insertions(+), 10 deletions(-) (limited to 'coreutils') diff --git a/coreutils/chmod.c b/coreutils/chmod.c index 11c6731a1..9a73218a1 100644 --- a/coreutils/chmod.c +++ b/coreutils/chmod.c @@ -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 diff --git a/coreutils/chown.c b/coreutils/chown.c index f92299e36..09b1a595b 100644 --- a/coreutils/chown.c +++ b/coreutils/chown.c @@ -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; } diff --git a/coreutils/diff.c b/coreutils/diff.c index 911bfcf4d..1903bb151 100644 --- a/coreutils/diff.c +++ b/coreutils/diff.c @@ -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; -- cgit v1.2.3