comparison src/readline-0-003.patch @ 5475:2b13fe9f4ef9

readline: Add upstream patches. * src/readline-0-001.patch, src/readline-0-002.patch, src/readline-0-003.patch, src/readline-0-004.patch: Add upstream patches (reformatted to apply in MXE): ftp://ftp.gnu.org/pub/gnu/readline/readline-8.0-patches * dist-files.mk: Include new files in list.
author Markus Mützel <markus.muetzel@gmx.de>
date Sun, 28 Jun 2020 15:41:14 +0200
parents
children
comparison
equal deleted inserted replaced
5474:f80eb3519e2a 5475:2b13fe9f4ef9
1 READLINE PATCH REPORT
2 =====================
3
4 Readline-Release: 8.0
5 Patch-ID: readline80-003
6
7 Bug-Reported-by: HIROSE Masaaki <hirose31@gmail.com>
8 Bug-Reference-ID: <CAGSOfA-RqiTe=+GsXsDKyZrrMWH4bDbXgMVVegMa6OjqC5xbnQ@mail.gmail.com>
9 Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2019-05/msg00038.html
10
11 Bug-Description:
12
13 Reading history entries with timestamps can result in history entries joined
14 by linefeeds.
15
16 diff --git "a/histfile.c" "b/histfile.c"
17 --- a/histfile.c 2018-06-11 09:14:52.000000000 -0400
18 +++ b/histfile.c 2019-05-16 15:55:57.000000000 -0400
19 @@ -370,7 +370,9 @@
20
21 has_timestamps = HIST_TIMESTAMP_START (buffer);
22 - history_multiline_entries += has_timestamps && history_write_timestamps;
23 + history_multiline_entries += has_timestamps && history_write_timestamps;
24
25 /* Skip lines until we are at FROM. */
26 + if (has_timestamps)
27 + last_ts = buffer;
28 for (line_start = line_end = buffer; line_end < bufend && current_line < from; line_end++)
29 if (*line_end == '\n')
30 @@ -381,5 +383,16 @@
31 if (HIST_TIMESTAMP_START(p) == 0)
32 current_line++;
33 + else
34 + last_ts = p;
35 line_start = p;
36 + /* If we are at the last line (current_line == from) but we have
37 + timestamps (has_timestamps), then line_start points to the
38 + text of the last command, and we need to skip to its end. */
39 + if (current_line >= from && has_timestamps)
40 + {
41 + for (line_end = p; line_end < bufend && *line_end != '\n'; line_end++)
42 + ;
43 + line_start = (*line_end == '\n') ? line_end + 1 : line_end;
44 + }
45 }
46
47 diff --git "a/patchlevel" "b/patchlevel"
48 --- a/patchlevel 2013-11-15 08:11:11.000000000 -0500
49 +++ b/patchlevel 2014-03-21 08:28:40.000000000 -0400
50 @@ -1,3 +1,3 @@
51 # Do not edit -- exists only for use by patch
52
53 -2
54 +3