mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.5 KiB

  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 3.2
  4. Patch-ID: bash32-004
  5. Bug-Reported-by: Stuart Shelton <srcshelton@gmail.com>
  6. Bug-Reference-ID: <619141e40610261203y6cda5aa6i23cb24c7aeba996e@mail.gmail.com>
  7. Bug-Reference-URL:
  8. Bug-Description:
  9. A bug in the parameter pattern substitution implementation treated a pattern
  10. whose first character was `/' (after expansion) as specifying global
  11. replacement.
  12. Patch:
  13. *** bash-3.2/subst.c Tue Sep 19 08:35:09 2006
  14. --- subst.c Thu Oct 26 09:17:50 2006
  15. ***************
  16. *** 5707,5712 ****
  17. --- 5707,5717 ----
  18. vtype &= ~VT_STARSUB;
  19. mflags = 0;
  20. + if (patsub && *patsub == '/')
  21. + {
  22. + mflags |= MATCH_GLOBREP;
  23. + patsub++;
  24. + }
  25. /* Malloc this because expand_string_if_necessary or one of the expansion
  26. functions in its call chain may free it on a substitution error. */
  27. ***************
  28. *** 5741,5753 ****
  29. }
  30. /* ksh93 doesn't allow the match specifier to be a part of the expanded
  31. ! pattern. This is an extension. */
  32. p = pat;
  33. ! if (pat && pat[0] == '/')
  34. ! {
  35. ! mflags |= MATCH_GLOBREP|MATCH_ANY;
  36. ! p++;
  37. ! }
  38. else if (pat && pat[0] == '#')
  39. {
  40. mflags |= MATCH_BEG;
  41. --- 5746,5757 ----
  42. }
  43. /* ksh93 doesn't allow the match specifier to be a part of the expanded
  44. ! pattern. This is an extension. Make sure we don't anchor the pattern
  45. ! at the beginning or end of the string if we're doing global replacement,
  46. ! though. */
  47. p = pat;
  48. ! if (mflags & MATCH_GLOBREP)
  49. ! mflags |= MATCH_ANY;
  50. else if (pat && pat[0] == '#')
  51. {
  52. mflags |= MATCH_BEG;
  53. *** bash-3.2/tests/new-exp.right Thu Aug 10 12:00:00 2006
  54. --- tests/new-exp.right Sun Oct 29 16:03:36 2006
  55. ***************
  56. *** 430,436 ****
  57. Case06---1---A B C::---
  58. Case07---3---A:B:C---
  59. Case08---3---A:B:C---
  60. ! ./new-exp.tests: line 506: /${$(($#-1))}: bad substitution
  61. argv[1] = <a>
  62. argv[2] = <b>
  63. argv[3] = <c>
  64. --- 430,436 ----
  65. Case06---1---A B C::---
  66. Case07---3---A:B:C---
  67. Case08---3---A:B:C---
  68. ! ./new-exp.tests: line 506: ${$(($#-1))}: bad substitution
  69. argv[1] = <a>
  70. argv[2] = <b>
  71. argv[3] = <c>
  72. *** bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006
  73. --- patchlevel.h Mon Oct 16 14:22:54 2006
  74. ***************
  75. *** 26,30 ****
  76. looks for to find the patch level (for the sccs version string). */
  77. ! #define PATCHLEVEL 3
  78. #endif /* _PATCHLEVEL_H_ */
  79. --- 26,30 ----
  80. looks for to find the patch level (for the sccs version string). */
  81. ! #define PATCHLEVEL 4
  82. #endif /* _PATCHLEVEL_H_ */