bash-4.2-032.patch 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 4.2
  4. Patch-ID: bash42-032
  5. Bug-Reported-by: Ruediger Kuhlmann <RKuhlmann@orga-systems.com>
  6. Bug-Reference-ID: <OFDE975207.0C3622E5-ONC12579F3.00361A06-C12579F3.00365E39@orga-systems.com>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-05/msg00010.html
  8. Bug-Description:
  9. Bash-4.2 has problems with DEL characters in the expanded value of variables
  10. used in the same quoted string as variables that expand to nothing.
  11. Patch (apply with `patch -p0'):
  12. *** ../bash-20120427/subst.c 2012-04-22 16:19:10.000000000 -0400
  13. --- ./subst.c 2012-05-07 16:06:35.000000000 -0400
  14. ***************
  15. *** 8152,8155 ****
  16. --- 8152,8163 ----
  17. dispose_word_desc (tword);
  18. + /* Kill quoted nulls; we will add them back at the end of
  19. + expand_word_internal if nothing else in the string */
  20. + if (had_quoted_null && temp && QUOTED_NULL (temp))
  21. + {
  22. + FREE (temp);
  23. + temp = (char *)NULL;
  24. + }
  25. +
  26. goto add_string;
  27. break;
  28. ***************
  29. *** 8556,8560 ****
  30. if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))
  31. tword->flags |= W_QUOTED;
  32. ! if (had_quoted_null)
  33. tword->flags |= W_HASQUOTEDNULL;
  34. list = make_word_list (tword, (WORD_LIST *)NULL);
  35. --- 8564,8568 ----
  36. if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))
  37. tword->flags |= W_QUOTED;
  38. ! if (had_quoted_null && QUOTED_NULL (istring))
  39. tword->flags |= W_HASQUOTEDNULL;
  40. list = make_word_list (tword, (WORD_LIST *)NULL);
  41. ***************
  42. *** 8587,8591 ****
  43. if (word->flags & W_NOEXPAND)
  44. tword->flags |= W_NOEXPAND;
  45. ! if (had_quoted_null)
  46. tword->flags |= W_HASQUOTEDNULL; /* XXX */
  47. list = make_word_list (tword, (WORD_LIST *)NULL);
  48. --- 8595,8599 ----
  49. if (word->flags & W_NOEXPAND)
  50. tword->flags |= W_NOEXPAND;
  51. ! if (had_quoted_null && QUOTED_NULL (istring))
  52. tword->flags |= W_HASQUOTEDNULL; /* XXX */
  53. list = make_word_list (tword, (WORD_LIST *)NULL);
  54. *** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
  55. --- ./patchlevel.h Thu Feb 24 21:41:34 2011
  56. ***************
  57. *** 26,30 ****
  58. looks for to find the patch level (for the sccs version string). */
  59. ! #define PATCHLEVEL 31
  60. #endif /* _PATCHLEVEL_H_ */
  61. --- 26,30 ----
  62. looks for to find the patch level (for the sccs version string). */
  63. ! #define PATCHLEVEL 32
  64. #endif /* _PATCHLEVEL_H_ */