rcolebaugh / rpms / bash

Forked from rpms/bash a year ago
Clone

Blame SOURCES/bash-4.3-noecho.patch

b92f7d
diff --git a/parse.y b/parse.y
b92f7d
index df1231d..2449fa8 100644
b92f7d
--- a/parse.y
b92f7d
+++ b/parse.y
b92f7d
@@ -4482,6 +4482,8 @@ xparse_dolparen (base, string, indp, flags)
b92f7d
   save_parser_state (&ps);
b92f7d
   save_input_line_state (&ls);
b92f7d
   orig_eof_token = shell_eof_token;
b92f7d
+  /* avoid echoing every substitution again */
b92f7d
+  echo_input_at_read = 0;
b92f7d
 #if defined (ALIAS) || defined (DPAREN_ARITHMETIC)
b92f7d
   saved_pushed_strings = pushed_string_list;	/* separate parsing context */
b92f7d
   pushed_string_list = (STRING_SAVER *)NULL;
b92f7d
diff --git a/subst.c b/subst.c
b92f7d
index 9ccbf33..8a9ee5c 100644
b92f7d
--- a/subst.c
b92f7d
+++ b/subst.c
b92f7d
@@ -9453,6 +9453,7 @@ param_expand (string, sindex, quoted, expanded_something,
b92f7d
   WORD_LIST *list, *l;
b92f7d
   WORD_DESC *tdesc, *ret;
b92f7d
   int tflag, nullarg;
b92f7d
+  int old_echo_input;
b92f7d
 
b92f7d
 /*itrace("param_expand: `%s' pflags = %d", string+*sindex, pflags);*/
b92f7d
   zindex = *sindex;
b92f7d
@@ -9843,6 +9844,9 @@ arithsub:
b92f7d
 	}
b92f7d
 
b92f7d
 comsub:
b92f7d
+      old_echo_input = echo_input_at_read;
b92f7d
+      /* avoid echoing every substitution again */
b92f7d
+      echo_input_at_read = 0;
b92f7d
       if (pflags & PF_NOCOMSUB)
b92f7d
 	/* we need zindex+1 because string[zindex] == RPAREN */
b92f7d
 	temp1 = substring (string, *sindex, zindex+1);
b92f7d
@@ -9855,6 +9859,7 @@ comsub:
b92f7d
 	}
b92f7d
       FREE (temp);
b92f7d
       temp = temp1;
b92f7d
+      echo_input_at_read = old_echo_input;
b92f7d
       break;
b92f7d
 
b92f7d
     /* Do POSIX.2d9-style arithmetic substitution.  This will probably go