From 925de5317c30f54c0a31c18041f3ff71a54428b1 Mon Sep 17 00:00:00 2001 From: jay Date: Wed, 8 Nov 2006 07:28:50 +0000 Subject: [PATCH] Fixed Savannah bug #15531; -prune should take effect ony if we are currently considering a directory --- ChangeLog | 5 +++++ find/pred.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4e5eef8..768b883 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-11-08 James Youngman + + * pred.c (pred_prune): -prune should have an effect only if we are + currently considering a directory (Savannah bug #15531). + 2006-10-15 James Youngman * lib/buildcmd.c: Fixed Savannah bug #17782, in which "find diff --git a/find/pred.c b/find/pred.c index ea67885..5924831 100644 --- a/find/pred.c +++ b/find/pred.c @@ -1289,9 +1289,13 @@ boolean pred_prune (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr) { (void) pathname; - (void) stat_buf; (void) pred_ptr; - state.stop_at_current_level = true; + + if (options.do_dir_first == true && + stat_buf != NULL && + S_ISDIR(stat_buf->st_mode)) + state.stop_at_current_level = true; + return (options.do_dir_first); /* This is what SunOS find seems to do. */ } -- 2.11.4.GIT