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.

73 lines
2.3 KiB

  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 5.0
  4. Patch-ID: bash50-013
  5. Bug-Reported-by: HIROSE Masaaki <hirose31@gmail.com>
  6. Bug-Reference-ID: <CAGSOfA-RqiTe=+GsXsDKyZrrMWH4bDbXgMVVegMa6OjqC5xbnQ@mail.gmail.com>
  7. Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2019-05/msg00038.html
  8. Bug-Description:
  9. Reading history entries with timestamps can result in history entries joined
  10. by linefeeds.
  11. Patch (apply with `patch -p0'):
  12. *** a/lib/readline/histfile.c 2018-06-11 09:14:52.000000000 -0400
  13. --- b/lib/readline/histfile.c 2019-05-16 15:55:57.000000000 -0400
  14. ***************
  15. *** 370,376 ****
  16. has_timestamps = HIST_TIMESTAMP_START (buffer);
  17. ! history_multiline_entries += has_timestamps && history_write_timestamps;
  18. /* Skip lines until we are at FROM. */
  19. for (line_start = line_end = buffer; line_end < bufend && current_line < from; line_end++)
  20. if (*line_end == '\n')
  21. --- 370,378 ----
  22. has_timestamps = HIST_TIMESTAMP_START (buffer);
  23. ! history_multiline_entries += has_timestamps && history_write_timestamps;
  24. /* Skip lines until we are at FROM. */
  25. + if (has_timestamps)
  26. + last_ts = buffer;
  27. for (line_start = line_end = buffer; line_end < bufend && current_line < from; line_end++)
  28. if (*line_end == '\n')
  29. ***************
  30. *** 381,385 ****
  31. --- 383,398 ----
  32. if (HIST_TIMESTAMP_START(p) == 0)
  33. current_line++;
  34. + else
  35. + last_ts = p;
  36. line_start = p;
  37. + /* If we are at the last line (current_line == from) but we have
  38. + timestamps (has_timestamps), then line_start points to the
  39. + text of the last command, and we need to skip to its end. */
  40. + if (current_line >= from && has_timestamps)
  41. + {
  42. + for (line_end = p; line_end < bufend && *line_end != '\n'; line_end++)
  43. + ;
  44. + line_start = (*line_end == '\n') ? line_end + 1 : line_end;
  45. + }
  46. }
  47. *** a/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
  48. --- b/patchlevel.h 2016-10-01 11:01:28.000000000 -0400
  49. ***************
  50. *** 26,30 ****
  51. looks for to find the patch level (for the sccs version string). */
  52. ! #define PATCHLEVEL 12
  53. #endif /* _PATCHLEVEL_H_ */
  54. --- 26,30 ----
  55. looks for to find the patch level (for the sccs version string). */
  56. ! #define PATCHLEVEL 13
  57. #endif /* _PATCHLEVEL_H_ */