From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) Description of problem: Earlier versions of find prints '.' when called as 'find . -prune'. This is consistent with the ocumentation. find 4.1.6 (as shipped with RedHat 7.1) prints nothing in this case, adding an explicit -print makes it print '.'. How reproducible: Always Steps to Reproduce: 1.find . -prune 2. 3. Actual Results: no output Expected Results: should have printed '.' Additional info: Earlier versions of find prints '.' when called as 'find . -prune'. This is consistent with the ocumentation. find 4.1.6 (as shipped with RedHat 7.1) prints nothing in this case, adding an explicit -print makes it print '.'. My guess as to why this happens is: From ChangeLog: 2000-05-13 Kevin Dalley <kevind> ... * find/parser.c (parse_prune): set side_effects to true, to prevent prune from being moved in opt_expr. Which corresponds to the code: parser.c: static boolean parse_prune (char **argv, int *arg_ptr) { struct predicate *our_pred; our_pred = insert_primary (pred_prune); our_pred->need_stat = false; /* -prune has a side effect that it does not descend into the current directory. */ our_pred->side_effects = true; return (true); } However, having side_effects is interpreted as 'producing output' in find.c, thus preventing an implicit '-print' from being added: else if (!no_side_effects (predicates->pred_next)) <<< [PM] (probably) true for -prune in 4.1.6 { /* One or more predicates that produce output were given; remove the unneeded initial `('. */ cur_pred = predicates; predicates = predicates->pred_next; free ((char *) cur_pred); } else <<< [PM] (probably) -prune got here in earlier releases { /* `( user-supplied-expression ) -print'. */ parse_close (argv, &argc); parse_print (argv, &argc); } This analysis is based only on a brief review of the source, I have not tried to verify it by compiling/debugging/whatever. This bug breaks the installation script for one of our software packages (the workaround for us is to explicitly add -print)
This seems to be fixed in findutils-4.1.7-1.