1 Star 0 Fork 38

smileknife/bash

forked from src-openEuler/bash 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bash-4.3-noecho.patch 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 10:32 . Package init
diff --git a/parse.y b/parse.y
index 07e6e3e..4cd373f 100644
--- a/parse.y
+++ b/parse.y
@@ -4410,6 +4410,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 9559187..0c2caa6 100644
--- a/subst.c
+++ b/subst.c
@@ -9145,6 +9145,7 @@ param_expand (string, sindex, quoted, expanded_something,
WORD_LIST *list;
WORD_DESC *tdesc, *ret;
int tflag;
+ int old_echo_input;
/*itrace("param_expand: `%s' pflags = %d", string+*sindex, pflags);*/
zindex = *sindex;
@@ -9514,6 +9515,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);
@@ -9526,6 +9530,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.17.2
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shanshishi/bash.git
[email protected]:shanshishi/bash.git
shanshishi
bash
bash
master

搜索帮助