rcolebaugh / rpms / bash

Forked from rpms/bash a year ago
Clone

Blame SOURCES/bash-4.2-noecho.patch

1d932a
--- bash-4.2/parse.y	2014-05-29 14:46:09.545543384 +0200
1d932a
+++ bash-4.2/parse.y	2014-05-29 14:48:40.758626213 +0200
1d932a
@@ -3858,6 +3858,8 @@ xparse_dolparen (base, string, indp, fla
1d932a
     sflags |= SEVAL_NOLONGJMP;
1d932a
   save_parser_state (&ps);
1d932a
   save_input_line_state (&ls);
1d932a
+  /* avoid echoing every substitution again */
1d932a
+  echo_input_at_read = 0;
1d932a
 
1d932a
   /*(*/
1d932a
   parser_state |= PST_CMDSUBST|PST_EOFTOKEN;	/* allow instant ')' */ /*(*/
1d932a
--- bash-4.2/subst.c	2014-05-29 16:04:35.802784549 +0200
1d932a
+++ bash-4.2/subst.c	2014-05-29 16:08:25.021942676 +0200
1d932a
@@ -7103,6 +7103,7 @@ param_expand (string, sindex, quoted, ex
1d932a
   WORD_LIST *list;
1d932a
   WORD_DESC *tdesc, *ret;
1d932a
   int tflag;
1d932a
+  int old_echo_input;
1d932a
 
1d932a
   zindex = *sindex;
1d932a
   c = string[++zindex];
1d932a
@@ -7401,6 +7402,9 @@ arithsub:
1d932a
 	}
1d932a
 
1d932a
 comsub:
1d932a
+      old_echo_input = echo_input_at_read;
1d932a
+      /* avoid echoing every substitution again */
1d932a
+      echo_input_at_read = 0;
1d932a
       if (pflags & PF_NOCOMSUB)
1d932a
 	/* we need zindex+1 because string[zindex] == RPAREN */
1d932a
 	temp1 = substring (string, *sindex, zindex+1);
1d932a
@@ -7413,6 +7417,7 @@ comsub:
1d932a
 	}
1d932a
       FREE (temp);
1d932a
       temp = temp1;
1d932a
+      echo_input_at_read = old_echo_input;
1d932a
       break;
1d932a
 
1d932a
     /* Do POSIX.2d9-style arithmetic substitution.  This will probably go