bash/bash-4.3-noecho.patch

58 lines
1.5 KiB
Diff
Raw Normal View History

2021-05-31 20:38:12 +08:00
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
---
2023-07-17 17:08:56 +08:00
parse.y | 3 +++
2021-05-31 20:38:12 +08:00
subst.c | 5 +++++
2023-07-17 17:08:56 +08:00
2 files changed, 8 insertions(+)
2021-05-31 20:38:12 +08:00
2019-09-30 10:32:12 -04:00
diff --git a/parse.y b/parse.y
2023-07-17 17:08:56 +08:00
index 1d12e63..8dca179 100644
2019-09-30 10:32:12 -04:00
--- a/parse.y
+++ b/parse.y
2023-07-17 17:08:56 +08:00
@@ -4262,6 +4262,9 @@ xparse_dolparen (base, string, indp, flags)
2019-09-30 10:32:12 -04:00
save_parser_state (&ps);
save_input_line_state (&ls);
2023-07-17 17:08:56 +08:00
2019-09-30 10:32:12 -04:00
+ /* avoid echoing every substitution again */
+ echo_input_at_read = 0;
2023-07-17 17:08:56 +08:00
+
2019-09-30 10:32:12 -04:00
#if defined (ALIAS) || defined (DPAREN_ARITHMETIC)
pushed_string_list = (STRING_SAVER *)NULL;
2023-07-17 17:08:56 +08:00
#endif
2019-09-30 10:32:12 -04:00
diff --git a/subst.c b/subst.c
2023-07-17 17:08:56 +08:00
index 1ac6eb2..2e76b80 100644
2019-09-30 10:32:12 -04:00
--- a/subst.c
+++ b/subst.c
2023-07-17 17:08:56 +08:00
@@ -10239,6 +10239,7 @@ param_expand (string, sindex, quoted, expanded_something,
2021-05-31 20:38:12 +08:00
WORD_LIST *list, *l;
2019-09-30 10:32:12 -04:00
WORD_DESC *tdesc, *ret;
2021-05-31 20:38:12 +08:00
int tflag, nullarg;
2019-09-30 10:32:12 -04:00
+ int old_echo_input;
/*itrace("param_expand: `%s' pflags = %d", string+*sindex, pflags);*/
zindex = *sindex;
2023-07-17 17:08:56 +08:00
@@ -10631,6 +10632,9 @@ arithsub:
2019-09-30 10:32:12 -04:00
}
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);
2023-07-17 17:08:56 +08:00
@@ -10643,6 +10647,7 @@ comsub:
2019-09-30 10:32:12 -04:00
}
FREE (temp);
temp = temp1;
+ echo_input_at_read = old_echo_input;
break;
/* Do POSIX.2d9-style arithmetic substitution. This will probably go
--
2023-07-17 17:08:56 +08:00
2.33.0
2021-05-31 20:38:12 +08:00