hush: if we did match "LINENO" or "OPTIND", stop further comparisons

function                                             old     new   delta
handle_changed_special_names                          99     101      +2

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2018-04-06 14:57:53 +02:00
parent cf079ffe1c
commit 00bd76728d

View File

@ -2134,12 +2134,16 @@ static void handle_changed_special_names(const char *name, unsigned name_len)
&& name_len == 6 && name_len == 6
) { ) {
#if ENABLE_HUSH_LINENO_VAR #if ENABLE_HUSH_LINENO_VAR
if (strncmp(name, "LINENO", 6) == 0) if (strncmp(name, "LINENO", 6) == 0) {
G.lineno_var = NULL; G.lineno_var = NULL;
return;
}
#endif #endif
#if ENABLE_HUSH_GETOPTS #if ENABLE_HUSH_GETOPTS
if (strncmp(name, "OPTIND", 6) == 0) if (strncmp(name, "OPTIND", 6) == 0) {
G.getopt_count = 0; G.getopt_count = 0;
return;
}
#endif #endif
} }
} }