diff options
Diffstat (limited to 'shell/hush.c')
-rw-r--r-- | shell/hush.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c index 8e0022531..d27550ba0 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -9956,7 +9956,7 @@ Test that VAR is a valid variable name? | |||
9956 | * until we get Nth result (or failure). | 9956 | * until we get Nth result (or failure). |
9957 | * (N == G.getopt_count is reset to 0 whenever OPTIND is [un]set). | 9957 | * (N == G.getopt_count is reset to 0 whenever OPTIND is [un]set). |
9958 | */ | 9958 | */ |
9959 | optind = 0; /* reset getopt() state */ | 9959 | GETOPT_RESET(); |
9960 | count = 0; | 9960 | count = 0; |
9961 | n = string_array_len(argv); | 9961 | n = string_array_len(argv); |
9962 | do { | 9962 | do { |
@@ -9971,6 +9971,7 @@ Test that VAR is a valid variable name? | |||
9971 | /* Set OPTIND. Prevent resetting of the magic counter! */ | 9971 | /* Set OPTIND. Prevent resetting of the magic counter! */ |
9972 | set_local_var_from_halves("OPTIND", utoa(optind)); | 9972 | set_local_var_from_halves("OPTIND", utoa(optind)); |
9973 | G.getopt_count = count; /* "next time, give me N+1'th result" */ | 9973 | G.getopt_count = count; /* "next time, give me N+1'th result" */ |
9974 | GETOPT_RESET(); /* just in case */ | ||
9974 | 9975 | ||
9975 | /* Set OPTARG */ | 9976 | /* Set OPTARG */ |
9976 | /* Always set or unset, never left as-is, even on exit/error: | 9977 | /* Always set or unset, never left as-is, even on exit/error: |