bash-4.4-case-in-command-subst.patch 608 B

12345678910111213141516171819
  1. diff --git a/parse.y b/parse.y
  2. --- a/parse.y
  3. +++ b/parse.y
  4. @@ -4011,11 +4011,13 @@ eof_error:
  5. tflags |= LEX_RESWDOK;
  6. lex_rwlen = 0;
  7. }
  8. - else
  9. + else if (shellmeta (ch) == 0)
  10. {
  11. tflags &= ~LEX_RESWDOK;
  12. /*itrace("parse_comsub:%d: found `%.4s', lex_reswdok -> 0", line_number, ret+retind-4);*/
  13. }
  14. + else /* can't be in a reserved word any more */
  15. + lex_rwlen = 0;
  16. }
  17. else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0)))
  18. ; /* don't modify LEX_RESWDOK if we're starting a comment */