bash/bash-4.3-noecho.patch
DistroBaker 62c46545a8 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/bash.git#a52a705fbcc97249e1abea732fe4e6fc73de767a
2021-01-07 13:40:37 +00:00

44 lines
1.4 KiB
Diff

diff --git a/parse.y b/parse.y
index df1231d..2449fa8 100644
--- a/parse.y
+++ b/parse.y
@@ -4482,6 +4482,8 @@ xparse_dolparen (base, string, indp, flags)
save_parser_state (&ps);
save_input_line_state (&ls);
orig_eof_token = shell_eof_token;
+ /* avoid echoing every substitution again */
+ echo_input_at_read = 0;
#if defined (ALIAS) || defined (DPAREN_ARITHMETIC)
saved_pushed_strings = pushed_string_list; /* separate parsing context */
pushed_string_list = (STRING_SAVER *)NULL;
diff --git a/subst.c b/subst.c
index 9ccbf33..8a9ee5c 100644
--- a/subst.c
+++ b/subst.c
@@ -9453,6 +9453,7 @@ param_expand (string, sindex, quoted, expanded_something,
WORD_LIST *list, *l;
WORD_DESC *tdesc, *ret;
int tflag, nullarg;
+ int old_echo_input;
/*itrace("param_expand: `%s' pflags = %d", string+*sindex, pflags);*/
zindex = *sindex;
@@ -9843,6 +9844,9 @@ arithsub:
}
comsub:
+ old_echo_input = echo_input_at_read;
+ /* avoid echoing every substitution again */
+ echo_input_at_read = 0;
if (pflags & PF_NOCOMSUB)
/* we need zindex+1 because string[zindex] == RPAREN */
temp1 = substring (string, *sindex, zindex+1);
@@ -9855,6 +9859,7 @@ comsub:
}
FREE (temp);
temp = temp1;
+ echo_input_at_read = old_echo_input;
break;
/* Do POSIX.2d9-style arithmetic substitution. This will probably go