As Larry pointed out, this the off by one canbe fixed much more elegantly.
authorEric Andersen <andersen@codepoet.org>
Thu, 26 Apr 2001 15:41:51 +0000 (15:41 -0000)
committerEric Andersen <andersen@codepoet.org>
Thu, 26 Apr 2001 15:41:51 +0000 (15:41 -0000)
chgrp.c
chmod.c
chown.c
coreutils/chgrp.c
coreutils/chmod.c
coreutils/chown.c

diff --git a/chgrp.c b/chgrp.c
index 83bb194635da11a22f64d958a7af2cb772a475c8..55e22f528f69e28dbdd98995b0888c72ccb76c77 100644 (file)
--- 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 f22e5d06f8ce9424810b50635bad982f13985366..b1d75129b3564cb35390ea965e9cd1f103b4aaf4 100644 (file)
--- 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 43d62b1e07d14c694f459664fdba6e8b799ddd4f..e714b2d7a0aac851bf256360ea4ce54a927a906f 100644 (file)
--- 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;
index 83bb194635da11a22f64d958a7af2cb772a475c8..55e22f528f69e28dbdd98995b0888c72ccb76c77 100644 (file)
@@ -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;
index f22e5d06f8ce9424810b50635bad982f13985366..b1d75129b3564cb35390ea965e9cd1f103b4aaf4 100644 (file)
@@ -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;
index 43d62b1e07d14c694f459664fdba6e8b799ddd4f..e714b2d7a0aac851bf256360ea4ce54a927a906f 100644 (file)
@@ -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;