58 lines
1.5 KiB
Diff
58 lines
1.5 KiB
Diff
From 65aaa91a4785092fe5fb6a8d4596abc5aba0b6f9 Mon Sep 17 00:00:00 2001
|
|
From: liujian <liujianliu.liu@huawei.com>
|
|
Date: Mon, 31 May 2021 22:52:29 +0800
|
|
Subject: [PATCH] bash-4.3-noecho
|
|
|
|
---
|
|
parse.y | 3 +++
|
|
subst.c | 5 +++++
|
|
2 files changed, 8 insertions(+)
|
|
|
|
diff --git a/parse.y b/parse.y
|
|
index 1d12e63..8dca179 100644
|
|
--- a/parse.y
|
|
+++ b/parse.y
|
|
@@ -4262,6 +4262,9 @@ xparse_dolparen (base, string, indp, flags)
|
|
save_parser_state (&ps);
|
|
save_input_line_state (&ls);
|
|
|
|
+ /* avoid echoing every substitution again */
|
|
+ echo_input_at_read = 0;
|
|
+
|
|
#if defined (ALIAS) || defined (DPAREN_ARITHMETIC)
|
|
pushed_string_list = (STRING_SAVER *)NULL;
|
|
#endif
|
|
diff --git a/subst.c b/subst.c
|
|
index 1ac6eb2..2e76b80 100644
|
|
--- a/subst.c
|
|
+++ b/subst.c
|
|
@@ -10239,6 +10239,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;
|
|
@@ -10631,6 +10632,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);
|
|
@@ -10643,6 +10647,7 @@ comsub:
|
|
}
|
|
FREE (temp);
|
|
temp = temp1;
|
|
+ echo_input_at_read = old_echo_input;
|
|
break;
|
|
|
|
/* Do POSIX.2d9-style arithmetic substitution. This will probably go
|
|
--
|
|
2.33.0
|
|
|