hush: GETOPT_RESET() _after_ getopts too.

NOEXEC'ed applets which use getopt() need this.

function                                             old     new   delta
builtin_getopts                                      403     413     +10

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2017-08-29 14:32:17 +02:00
parent 55af51c66d
commit 6016181b68
4 changed files with 6 additions and 5 deletions

View File

@@ -517,7 +517,7 @@ vgetopt32(char **argv, const char *applet_opts, const char *applet_long_options,
}
/* In case getopt32 was already called:
* reset the libc getopt() function, which keeps internal state.
* reset libc getopt() internal state.
* run_nofork_applet() does this, but we might end up here
* also via gunzip_main() -> gzip_main(). Play safe.
*/