diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-09-07 21:44:44 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-09-07 21:44:44 +0200 |
commit | 574b9c446da11baaf89551f09f951d6523eff731 (patch) | |
tree | 9515e4372df7febcb2ed47406152a391df1290b4 | |
parent | bcff3a7b5ab3302ea03a471bae195f8454008a20 (diff) | |
download | busybox-w32-574b9c446da11baaf89551f09f951d6523eff731.tar.gz busybox-w32-574b9c446da11baaf89551f09f951d6523eff731.tar.bz2 busybox-w32-574b9c446da11baaf89551f09f951d6523eff731.zip |
hush: fix var_LINENO3.tests failure
function old new delta
parse_and_run_string 40 62 +22
i_getch 105 102 -3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 22/-3) Total: 19 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/hush.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/shell/hush.c b/shell/hush.c index 5fafa322c..6d472337f 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -2753,6 +2753,12 @@ static int i_getch(struct in_str *i) | |||
2753 | if (ch != '\0') { | 2753 | if (ch != '\0') { |
2754 | i->p++; | 2754 | i->p++; |
2755 | i->last_char = ch; | 2755 | i->last_char = ch; |
2756 | #if ENABLE_HUSH_LINENO_VAR | ||
2757 | if (ch == '\n') { | ||
2758 | G.parse_lineno++; | ||
2759 | debug_printf_parse("G.parse_lineno++ = %u\n", G.parse_lineno); | ||
2760 | } | ||
2761 | #endif | ||
2756 | return ch; | 2762 | return ch; |
2757 | } | 2763 | } |
2758 | return EOF; | 2764 | return EOF; |
@@ -7540,11 +7546,11 @@ static void parse_and_run_stream(struct in_str *inp, int end_trigger) | |||
7540 | static void parse_and_run_string(const char *s) | 7546 | static void parse_and_run_string(const char *s) |
7541 | { | 7547 | { |
7542 | struct in_str input; | 7548 | struct in_str input; |
7543 | //IF_HUSH_LINENO_VAR(unsigned sv = G.parse_lineno;) | 7549 | IF_HUSH_LINENO_VAR(unsigned sv = G.parse_lineno;) |
7544 | 7550 | ||
7545 | setup_string_in_str(&input, s); | 7551 | setup_string_in_str(&input, s); |
7546 | parse_and_run_stream(&input, '\0'); | 7552 | parse_and_run_stream(&input, '\0'); |
7547 | //IF_HUSH_LINENO_VAR(G.parse_lineno = sv;) | 7553 | IF_HUSH_LINENO_VAR(G.parse_lineno = sv;) |
7548 | } | 7554 | } |
7549 | 7555 | ||
7550 | static void parse_and_run_file(HFILE *fp) | 7556 | static void parse_and_run_file(HFILE *fp) |