hush: fix "getopts" builtin to not be upset by other builtins calling getopt()

function                                             old     new   delta
builtin_getopts                                      363     403     +40
unset_local_var_len                                  185     215     +30
set_local_var                                        440     466     +26
reset_traps_to_defaults                              151     157      +6
pseudo_exec_argv                                     320     326      +6
install_special_sighandlers                           52      58      +6
pick_sighandler                                       62      65      +3
execvp_or_die                                         85      88      +3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 8/0 up/down: 120/0)             Total: 120 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2017-08-29 13:38:30 +02:00
parent 0d1eaf407c
commit 238ff98bb8
5 changed files with 133 additions and 15 deletions

View File

@@ -0,0 +1,14 @@
var:a
var:b
var:c
var:a
var:b
var:c
Illegal option -d
var:?
Illegal option -e
var:?
Illegal option -f
var:?
var:a
End: var:? OPTIND:6