1 Star 0 Fork 39

src-oepkgs-oE-rv/bash

forked from src-openEuler/bash 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bash-4.3-noecho.patch 1.62 KB
一键复制 编辑 原始数据 按行查看 历史
JeanLeo 提交于 2021-05-31 20:38 . upgrade to 5.1
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 | 2 ++
subst.c | 5 +++++
2 files changed, 7 insertions(+)
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
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-oepkgs-oe-rv/bash.git
git@gitee.com:src-oepkgs-oe-rv/bash.git
src-oepkgs-oe-rv
bash
bash
master

搜索帮助