bash-4.2-035.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 4.2
  4. Patch-ID: bash42-035
  5. Bug-Reported-by: Dan Douglas <ormaaj@gmail.com>
  6. Bug-Reference-ID: <2766482.Ksm3GrSoYi@smorgbox>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-06/msg00071.html
  8. Bug-Description:
  9. When given a number of lines to read, `mapfile -n lines' reads one too many.
  10. Patch (apply with `patch -p0'):
  11. *** ../bash-4.2-patched/builtins/mapfile.def 2010-05-29 22:09:47.000000000 -0400
  12. --- ./builtins/mapfile.def 2012-06-20 09:48:33.000000000 -0400
  13. ***************
  14. *** 196,206 ****
  15. interrupt_immediately++;
  16. for (array_index = origin, line_count = 1;
  17. ! zgetline (fd, &line, &line_length, unbuffered_read) != -1;
  18. ! array_index++, line_count++)
  19. {
  20. - /* Have we exceeded # of lines to store? */
  21. - if (line_count_goal != 0 && line_count > line_count_goal)
  22. - break;
  23. -
  24. /* Remove trailing newlines? */
  25. if (flags & MAPF_CHOP)
  26. --- 196,202 ----
  27. interrupt_immediately++;
  28. for (array_index = origin, line_count = 1;
  29. ! zgetline (fd, &line, &line_length, unbuffered_read) != -1;
  30. ! array_index++)
  31. {
  32. /* Remove trailing newlines? */
  33. if (flags & MAPF_CHOP)
  34. ***************
  35. *** 218,221 ****
  36. --- 214,222 ----
  37. bind_array_element (entry, array_index, line, 0);
  38. +
  39. + /* Have we exceeded # of lines to store? */
  40. + line_count++;
  41. + if (line_count_goal != 0 && line_count > line_count_goal)
  42. + break;
  43. }
  44. *** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
  45. --- ./patchlevel.h Thu Feb 24 21:41:34 2011
  46. ***************
  47. *** 26,30 ****
  48. looks for to find the patch level (for the sccs version string). */
  49. ! #define PATCHLEVEL 34
  50. #endif /* _PATCHLEVEL_H_ */
  51. --- 26,30 ----
  52. looks for to find the patch level (for the sccs version string). */
  53. ! #define PATCHLEVEL 35
  54. #endif /* _PATCHLEVEL_H_ */