summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-04-26 15:41:51 +0000
committerEric Andersen <andersen@codepoet.org>2001-04-26 15:41:51 +0000
commit3c3277f0bda79b66b35e5e965e5340624d29a459 (patch)
tree4110e6df0e3a6fe01d34bf575cb5c0039def1ec0
parent30592a54514ca52253ed5f2eff64684e32d7ff05 (diff)
As Larry pointed out, this the off by one canbe fixed much more elegantly.
-rw-r--r--chgrp.c2
-rw-r--r--chmod.c2
-rw-r--r--chown.c2
-rw-r--r--coreutils/chgrp.c2
-rw-r--r--coreutils/chmod.c2
-rw-r--r--coreutils/chown.c2
6 files changed, 6 insertions, 6 deletions
diff --git a/chgrp.c b/chgrp.c
index 83bb19463..55e22f528 100644
--- a/chgrp.c
+++ b/chgrp.c
@@ -71,7 +71,7 @@ int chgrp_main(int argc, char **argv)
}
/* Ok, ready to do the deed now */
- while (optind++ < argc-1) {
+ while (++optind < argc) {
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
fileAction, fileAction, NULL) == FALSE) {
return EXIT_FAILURE;
diff --git a/chmod.c b/chmod.c
index f22e5d06f..b1d75129b 100644
--- a/chmod.c
+++ b/chmod.c
@@ -66,7 +66,7 @@ int chmod_main(int argc, char **argv)
}
/* Ok, ready to do the deed now */
- while (optind++ < argc-1) {
+ while (++optind < argc) {
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
fileAction, fileAction, NULL) == FALSE) {
return EXIT_FAILURE;
diff --git a/chown.c b/chown.c
index 43d62b1e0..e714b2d7a 100644
--- a/chown.c
+++ b/chown.c
@@ -85,7 +85,7 @@ int chown_main(int argc, char **argv)
}
/* Ok, ready to do the deed now */
- while (optind++ < argc-1) {
+ while (++optind < argc) {
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
fileAction, fileAction, NULL) == FALSE) {
return EXIT_FAILURE;
diff --git a/coreutils/chgrp.c b/coreutils/chgrp.c
index 83bb19463..55e22f528 100644
--- a/coreutils/chgrp.c
+++ b/coreutils/chgrp.c
@@ -71,7 +71,7 @@ int chgrp_main(int argc, char **argv)
}
/* Ok, ready to do the deed now */
- while (optind++ < argc-1) {
+ while (++optind < argc) {
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
fileAction, fileAction, NULL) == FALSE) {
return EXIT_FAILURE;
diff --git a/coreutils/chmod.c b/coreutils/chmod.c
index f22e5d06f..b1d75129b 100644
--- a/coreutils/chmod.c
+++ b/coreutils/chmod.c
@@ -66,7 +66,7 @@ int chmod_main(int argc, char **argv)
}
/* Ok, ready to do the deed now */
- while (optind++ < argc-1) {
+ while (++optind < argc) {
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
fileAction, fileAction, NULL) == FALSE) {
return EXIT_FAILURE;
diff --git a/coreutils/chown.c b/coreutils/chown.c
index 43d62b1e0..e714b2d7a 100644
--- a/coreutils/chown.c
+++ b/coreutils/chown.c
@@ -85,7 +85,7 @@ int chown_main(int argc, char **argv)
}
/* Ok, ready to do the deed now */
- while (optind++ < argc-1) {
+ while (++optind < argc) {
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
fileAction, fileAction, NULL) == FALSE) {
return EXIT_FAILURE;