From 6730a7920d9439d6dafcdfa57e96ebcd9dba1c8e Mon Sep 17 00:00:00 2001 From: ceri Date: Wed, 18 Feb 2004 18:45:11 +0000 Subject: Only call chflags() on directories once. Approved by: ru MFC after: 1 week --- bin/chflags/chflags.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'bin/chflags') diff --git a/bin/chflags/chflags.c b/bin/chflags/chflags.c index 0f42f1a..40b302b 100644 --- a/bin/chflags/chflags.c +++ b/bin/chflags/chflags.c @@ -132,11 +132,10 @@ main(int argc, char *argv[]) for (rval = 0; (p = fts_read(ftsp)) != NULL;) { switch (p->fts_info) { - case FTS_D: - if (Rflag) /* Change it at FTS_DP. */ - continue; - fts_set(ftsp, p, FTS_SKIP); - break; + case FTS_D: /* Change it at FTS_DP if we're recursive. */ + if (!Rflag) + fts_set(ftsp, p, FTS_SKIP); + continue; case FTS_DNR: /* Warn, chflag, continue. */ warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); rval = 1; -- cgit v1.1