bash-4.3-noecho.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. diff --git a/parse.y b/parse.y
  2. index 30425a5..85f1c4f 100644
  3. --- a/parse.y
  4. +++ b/parse.y
  5. @@ -4228,6 +4228,8 @@ xparse_dolparen (base, string, indp, flags)
  6. save_parser_state (&ps);
  7. save_input_line_state (&ls);
  8. orig_eof_token = shell_eof_token;
  9. + /* avoid echoing every substitution again */
  10. + echo_input_at_read = 0;
  11. /*(*/
  12. parser_state |= PST_CMDSUBST|PST_EOFTOKEN; /* allow instant ')' */ /*(*/
  13. diff --git a/subst.c b/subst.c
  14. index f1a4df1..a93a4ce 100644
  15. --- a/subst.c
  16. +++ b/subst.c
  17. @@ -8513,6 +8513,7 @@ param_expand (string, sindex, quoted, expanded_something,
  18. WORD_LIST *list;
  19. WORD_DESC *tdesc, *ret;
  20. int tflag;
  21. + int old_echo_input;
  22. /*itrace("param_expand: `%s' pflags = %d", string+*sindex, pflags);*/
  23. zindex = *sindex;
  24. @@ -8831,6 +8832,9 @@ arithsub:
  25. }
  26. comsub:
  27. + old_echo_input = echo_input_at_read;
  28. + /* avoid echoing every substitution again */
  29. + echo_input_at_read = 0;
  30. if (pflags & PF_NOCOMSUB)
  31. /* we need zindex+1 because string[zindex] == RPAREN */
  32. temp1 = substring (string, *sindex, zindex+1);
  33. @@ -8843,6 +8847,7 @@ comsub:
  34. }
  35. FREE (temp);
  36. temp = temp1;
  37. + echo_input_at_read = old_echo_input;
  38. break;
  39. /* Do POSIX.2d9-style arithmetic substitution. This will probably go
  40. --
  41. 2.9.3