aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/chflags/chflags.c5
-rw-r--r--bin/chmod/chmod.c5
-rw-r--r--usr.bin/chflags/chflags.c5
-rw-r--r--usr.sbin/chown/chown.c5
4 files changed, 12 insertions, 8 deletions
diff --git a/bin/chflags/chflags.c b/bin/chflags/chflags.c
index 40c5b3f432b8..f46baa0efaeb 100644
--- a/bin/chflags/chflags.c
+++ b/bin/chflags/chflags.c
@@ -99,15 +99,16 @@ main(argc, argv)
if (argc < 2)
usage();
- fts_options = FTS_PHYSICAL;
if (Rflag) {
+ fts_options = FTS_PHYSICAL;
if (Hflag)
fts_options |= FTS_COMFOLLOW;
if (Lflag) {
fts_options &= ~FTS_PHYSICAL;
fts_options |= FTS_LOGICAL;
}
- }
+ } else
+ fts_options = FTS_LOGICAL;
flags = *argv;
if (*flags >= '0' && *flags <= '7') {
diff --git a/bin/chmod/chmod.c b/bin/chmod/chmod.c
index 112915159645..7a843c755bf7 100644
--- a/bin/chmod/chmod.c
+++ b/bin/chmod/chmod.c
@@ -134,8 +134,8 @@ done: argv += optind;
if (argc < 2)
usage();
- fts_options = FTS_PHYSICAL;
if (Rflag) {
+ fts_options = FTS_PHYSICAL;
if (hflag)
errx(1,
"the -R and -h options may not be specified together.");
@@ -145,7 +145,8 @@ done: argv += optind;
fts_options &= ~FTS_PHYSICAL;
fts_options |= FTS_LOGICAL;
}
- }
+ } else
+ fts_options = FTS_LOGICAL;
mode = *argv;
if (*mode >= '0' && *mode <= '7') {
diff --git a/usr.bin/chflags/chflags.c b/usr.bin/chflags/chflags.c
index 40c5b3f432b8..f46baa0efaeb 100644
--- a/usr.bin/chflags/chflags.c
+++ b/usr.bin/chflags/chflags.c
@@ -99,15 +99,16 @@ main(argc, argv)
if (argc < 2)
usage();
- fts_options = FTS_PHYSICAL;
if (Rflag) {
+ fts_options = FTS_PHYSICAL;
if (Hflag)
fts_options |= FTS_COMFOLLOW;
if (Lflag) {
fts_options &= ~FTS_PHYSICAL;
fts_options |= FTS_LOGICAL;
}
- }
+ } else
+ fts_options = FTS_LOGICAL;
flags = *argv;
if (*flags >= '0' && *flags <= '7') {
diff --git a/usr.sbin/chown/chown.c b/usr.sbin/chown/chown.c
index dacf623bb06a..b86af0e42730 100644
--- a/usr.sbin/chown/chown.c
+++ b/usr.sbin/chown/chown.c
@@ -122,8 +122,8 @@ main(argc, argv)
if (argc < 2)
usage();
- fts_options = FTS_PHYSICAL;
if (Rflag) {
+ fts_options = FTS_PHYSICAL;
if (hflag && (Lflag || Hflag))
errx(1, "the -R and -h options may not be specified together");
if (Hflag)
@@ -132,7 +132,8 @@ main(argc, argv)
fts_options &= ~FTS_PHYSICAL;
fts_options |= FTS_LOGICAL;
}
- }
+ } else
+ fts_options = FTS_LOGICAL;
uid = gid = -1;
if (ischown) {