summaryrefslogtreecommitdiffstats
path: root/bin/chflags
diff options
context:
space:
mode:
Diffstat (limited to 'bin/chflags')
-rw-r--r--bin/chflags/chflags.c9
1 files changed, 4 insertions, 5 deletions
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;
OpenPOWER on IntegriCloud