1 Star 0 Fork 38

Wodahs/bash

forked from src-openEuler/bash 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bash-4.3-noecho.patch 1.53 KB
一键复制 编辑 原始数据 按行查看 历史
wangyuhang 提交于 2023-07-17 17:08 . bash: update to 5.2.15
From 65aaa91a4785092fe5fb6a8d4596abc5aba0b6f9 Mon Sep 17 00:00:00 2001
From: liujian <[email protected]>
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wodahs0/bash.git
[email protected]:wodahs0/bash.git
wodahs0
bash
bash
master

搜索帮助