projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9f59849
)
svc: fix a case where with more than option, getopt() state is not reset
author
Denys Vlasenko
<vda.linux@googlemail.com>
Fri, 4 Aug 2017 23:38:55 +0000
(
01:38
+0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Fri, 4 Aug 2017 23:38:55 +0000
(
01:38
+0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
runit/sv.c
patch
|
blob
|
history
diff --git
a/runit/sv.c
b/runit/sv.c
index 3dd02550aecbaea8f219229e097fe37bb2461284..3267c7e4c1da5c8bc70013d166c7fcb4559d677a 100644
(file)
--- a/
runit/sv.c
+++ b/
runit/sv.c
@@
-718,15
+718,16
@@
int svc_main(int argc UNUSED_PARAM, char **argv)
argv[1] = command;
command[1] = '\0';
- /* getopt32() was already called:
- * reset the libc getopt() function, which keeps internal state.
- */
- GETOPT_RESET();
-
do {
if (opts & 1) {
int r;
+
command[0] = *optstring;
+
+ /* getopt() was already called by getopt32():
+ * reset the libc getopt() function's internal state.
+ */
+ GETOPT_RESET();
r = sv(argv);
if (r)
return 1;