As Larry pointed out, this the off by one canbe fixed much more elegantly.
This commit is contained in:
parent
30592a5451
commit
3c3277f0bd
6 changed files with 6 additions and 6 deletions
2
chgrp.c
2
chgrp.c
|
@ -71,7 +71,7 @@ int chgrp_main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ok, ready to do the deed now */
|
/* Ok, ready to do the deed now */
|
||||||
while (optind++ < argc-1) {
|
while (++optind < argc) {
|
||||||
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
|
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
|
||||||
fileAction, fileAction, NULL) == FALSE) {
|
fileAction, fileAction, NULL) == FALSE) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
2
chmod.c
2
chmod.c
|
@ -66,7 +66,7 @@ int chmod_main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ok, ready to do the deed now */
|
/* Ok, ready to do the deed now */
|
||||||
while (optind++ < argc-1) {
|
while (++optind < argc) {
|
||||||
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
|
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
|
||||||
fileAction, fileAction, NULL) == FALSE) {
|
fileAction, fileAction, NULL) == FALSE) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
2
chown.c
2
chown.c
|
@ -85,7 +85,7 @@ int chown_main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ok, ready to do the deed now */
|
/* Ok, ready to do the deed now */
|
||||||
while (optind++ < argc-1) {
|
while (++optind < argc) {
|
||||||
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
|
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
|
||||||
fileAction, fileAction, NULL) == FALSE) {
|
fileAction, fileAction, NULL) == FALSE) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
|
@ -71,7 +71,7 @@ int chgrp_main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ok, ready to do the deed now */
|
/* Ok, ready to do the deed now */
|
||||||
while (optind++ < argc-1) {
|
while (++optind < argc) {
|
||||||
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
|
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
|
||||||
fileAction, fileAction, NULL) == FALSE) {
|
fileAction, fileAction, NULL) == FALSE) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
|
@ -66,7 +66,7 @@ int chmod_main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ok, ready to do the deed now */
|
/* Ok, ready to do the deed now */
|
||||||
while (optind++ < argc-1) {
|
while (++optind < argc) {
|
||||||
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
|
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
|
||||||
fileAction, fileAction, NULL) == FALSE) {
|
fileAction, fileAction, NULL) == FALSE) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
|
@ -85,7 +85,7 @@ int chown_main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ok, ready to do the deed now */
|
/* Ok, ready to do the deed now */
|
||||||
while (optind++ < argc-1) {
|
while (++optind < argc) {
|
||||||
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
|
if (recursive_action (argv[optind], recursiveFlag, FALSE, FALSE,
|
||||||
fileAction, fileAction, NULL) == FALSE) {
|
fileAction, fileAction, NULL) == FALSE) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue