bash-4.2-001.patch 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 4.2
  4. Patch-ID: bash42-001
  5. Bug-Reported-by: Juergen Daubert <jue@jue.li>
  6. Bug-Reference-ID: <20110214175132.GA19813@jue.netz>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00125.html
  8. Bug-Description:
  9. When running in Posix mode, bash does not correctly expand the right-hand
  10. side of a double-quoted word expansion containing single quotes.
  11. Patch (apply with `patch -p0'):
  12. *** ../bash-4.2-patched/subst.c 2011-01-02 16:12:51.000000000 -0500
  13. --- ./subst.c 2011-02-19 00:00:00.000000000 -0500
  14. ***************
  15. *** 1380,1387 ****
  16. /* The handling of dolbrace_state needs to agree with the code in parse.y:
  17. ! parse_matched_pair() */
  18. ! dolbrace_state = 0;
  19. ! if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))
  20. ! dolbrace_state = (flags & SX_POSIXEXP) ? DOLBRACE_QUOTE : DOLBRACE_PARAM;
  21. i = *sindex;
  22. --- 1380,1389 ----
  23. /* The handling of dolbrace_state needs to agree with the code in parse.y:
  24. ! parse_matched_pair(). The different initial value is to handle the
  25. ! case where this function is called to parse the word in
  26. ! ${param op word} (SX_WORD). */
  27. ! dolbrace_state = (flags & SX_WORD) ? DOLBRACE_WORD : DOLBRACE_PARAM;
  28. ! if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && (flags & SX_POSIXEXP))
  29. ! dolbrace_state = DOLBRACE_QUOTE;
  30. i = *sindex;
  31. ***************
  32. *** 7177,7181 ****
  33. /* Extract the contents of the ${ ... } expansion
  34. according to the Posix.2 rules. */
  35. ! value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#') ? SX_POSIXEXP : 0);
  36. if (string[sindex] == RBRACE)
  37. sindex++;
  38. --- 7181,7185 ----
  39. /* Extract the contents of the ${ ... } expansion
  40. according to the Posix.2 rules. */
  41. ! value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#' || c =='/' || c == '^' || c == ',' || c ==':') ? SX_POSIXEXP|SX_WORD : SX_WORD);
  42. if (string[sindex] == RBRACE)
  43. sindex++;
  44. *** ../bash-4.2-patched/subst.h 2010-12-02 20:21:29.000000000 -0500
  45. --- ./subst.h 2011-02-16 21:12:09.000000000 -0500
  46. ***************
  47. *** 57,60 ****
  48. --- 57,61 ----
  49. #define SX_ARITHSUB 0x0080 /* extracting $(( ... )) (currently unused) */
  50. #define SX_POSIXEXP 0x0100 /* extracting new Posix pattern removal expansions in extract_dollar_brace_string */
  51. + #define SX_WORD 0x0200 /* extracting word in ${param op word} */
  52. /* Remove backslashes which are quoting backquotes from STRING. Modifies
  53. *** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
  54. --- ./patchlevel.h Thu Feb 24 21:41:34 2011
  55. ***************
  56. *** 26,30 ****
  57. looks for to find the patch level (for the sccs version string). */
  58. ! #define PATCHLEVEL 0
  59. #endif /* _PATCHLEVEL_H_ */
  60. --- 26,30 ----
  61. looks for to find the patch level (for the sccs version string). */
  62. ! #define PATCHLEVEL 1
  63. #endif /* _PATCHLEVEL_H_ */