bash31-015 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 3.1
  4. Patch-ID: bash31-015
  5. Bug-Reported-by: Benoit Vila
  6. Bug-Reference-ID: <43FCA614.1090108@free.fr>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2006-02/msg00058.html
  8. Bug-Description:
  9. A problem with the extended globbing code prevented dots from matching
  10. filenames when used in some extended matching patterns.
  11. Patch:
  12. *** bash-3.1/lib/glob/sm_loop.c Sun Oct 16 21:21:04 2005
  13. --- bash-3.1/lib/glob/sm_loop.c Mon Feb 27 17:18:43 2006
  14. ***************
  15. *** 639,643 ****
  16. CHAR *pnext; /* pointer to next sub-pattern */
  17. CHAR *srest; /* pointer to rest of string */
  18. ! int m1, m2;
  19. #if DEBUG_MATCHING
  20. --- 638,642 ----
  21. CHAR *pnext; /* pointer to next sub-pattern */
  22. CHAR *srest; /* pointer to rest of string */
  23. ! int m1, m2, xflags; /* xflags = flags passed to recursive matches */
  24. #if DEBUG_MATCHING
  25. ***************
  26. *** 645,648 ****
  27. --- 644,648 ----
  28. fprintf(stderr, "extmatch: s = %s; se = %s\n", s, se);
  29. fprintf(stderr, "extmatch: p = %s; pe = %s\n", p, pe);
  30. + fprintf(stderr, "extmatch: flags = %d\n", flags);
  31. #endif
  32. ***************
  33. *** 678,683 ****
  34. multiple matches of the pattern. */
  35. if (m1)
  36. ! m2 = (GMATCH (srest, se, prest, pe, flags) == 0) ||
  37. ! (s != srest && GMATCH (srest, se, p - 1, pe, flags) == 0);
  38. if (m1 && m2)
  39. return (0);
  40. --- 678,687 ----
  41. multiple matches of the pattern. */
  42. if (m1)
  43. ! {
  44. ! /* if srest > s, we are not at start of string */
  45. ! xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags;
  46. ! m2 = (GMATCH (srest, se, prest, pe, xflags) == 0) ||
  47. ! (s != srest && GMATCH (srest, se, p - 1, pe, xflags) == 0);
  48. ! }
  49. if (m1 && m2)
  50. return (0);
  51. ***************
  52. *** 705,710 ****
  53. for ( ; srest <= se; srest++)
  54. {
  55. if (GMATCH (s, srest, psub, pnext - 1, flags) == 0 &&
  56. ! GMATCH (srest, se, prest, pe, flags) == 0)
  57. return (0);
  58. }
  59. --- 709,716 ----
  60. for ( ; srest <= se; srest++)
  61. {
  62. + /* if srest > s, we are not at start of string */
  63. + xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags;
  64. if (GMATCH (s, srest, psub, pnext - 1, flags) == 0 &&
  65. ! GMATCH (srest, se, prest, pe, xflags) == 0)
  66. return (0);
  67. }
  68. ***************
  69. *** 727,731 ****
  70. break;
  71. }
  72. ! if (m1 == 0 && GMATCH (srest, se, prest, pe, flags) == 0)
  73. return (0);
  74. }
  75. --- 733,739 ----
  76. break;
  77. }
  78. ! /* if srest > s, we are not at start of string */
  79. ! xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags;
  80. ! if (m1 == 0 && GMATCH (srest, se, prest, pe, xflags) == 0)
  81. return (0);
  82. }
  83. *** bash-3.1/patchlevel.h Wed Jul 20 13:58:20 2005
  84. --- bash-3.1/patchlevel.h Wed Dec 7 13:48:42 2005
  85. ***************
  86. *** 26,30 ****
  87. looks for to find the patch level (for the sccs version string). */
  88. ! #define PATCHLEVEL 14
  89. #endif /* _PATCHLEVEL_H_ */
  90. --- 26,30 ----
  91. looks for to find the patch level (for the sccs version string). */
  92. ! #define PATCHLEVEL 15
  93. #endif /* _PATCHLEVEL_H_ */