update to 8.1

Signed-off-by: yang_zhuang_zhuang <1162011203@qq.com>
This commit is contained in:
yang_zhuang_zhuang 2021-09-27 10:03:28 +08:00
parent 809d23e5dd
commit bfeab70a7c
8 changed files with 9 additions and 200 deletions

View File

@ -1,35 +0,0 @@
From f585708e822e021e15e5bece1de482b63ba581df Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Wed, 14 Aug 2019 11:28:48 -0400
Subject: [PATCH 1/4] Readline-8.0 patch 1: fix file descriptor leak with
zero-length history file
---
histfile.c | 1 +
patchlevel | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/histfile.c b/histfile.c
index dc64bde..a8a92aa 100644
--- a/histfile.c
+++ b/histfile.c
@@ -305,6 +305,7 @@ read_history_range (const char *filename, int from, int to)
if (file_size == 0)
{
free (input);
+ close (file);
return 0; /* don't waste time if we don't have to */
}
diff --git a/patchlevel b/patchlevel
index d8c9df7..fdf4740 100644
--- a/patchlevel
+++ b/patchlevel
@@ -1,3 +1,3 @@
# Do not edit -- exists only for use by patch
-0
+1
--
1.8.3.1

View File

@ -1,52 +0,0 @@
From d063aa6a54e670adeaa9b71385394dbf8dc9ff63 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Fri, 7 Feb 2020 14:56:45 -0500
Subject: [PATCH 2/4] fix problems moving back beyond start of history
---
misc.c | 5 ++++-
patchlevel | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/misc.c b/misc.c
index 64b1457..42005b0 100644
--- a/misc.c
+++ b/misc.c
@@ -576,6 +576,7 @@ int
rl_get_previous_history (int count, int key)
{
HIST_ENTRY *old_temp, *temp;
+ int had_saved_line;
if (count < 0)
return (rl_get_next_history (-count, key));
@@ -588,6 +589,7 @@ rl_get_previous_history (int count, int key)
_rl_history_saved_point = (rl_point == rl_end) ? -1 : rl_point;
/* If we don't have a line saved, then save this one. */
+ had_saved_line = _rl_saved_line_for_history != 0;
rl_maybe_save_line ();
/* If the current line has changed, save the changes. */
@@ -611,7 +613,8 @@ rl_get_previous_history (int count, int key)
if (temp == 0)
{
- rl_maybe_unsave_line ();
+ if (had_saved_line == 0)
+ _rl_free_saved_history_line ();
rl_ding ();
}
else
diff --git a/patchlevel b/patchlevel
index fdf4740..7cbda82 100644
--- a/patchlevel
+++ b/patchlevel
@@ -1,3 +1,3 @@
# Do not edit -- exists only for use by patch
-1
+2
--
1.8.3.1

View File

@ -1,43 +0,0 @@
From c5ad6be530f5c1daf64a2d20df4baba9f6b57aa4 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Fri, 7 Feb 2020 14:58:55 -0500
Subject: [PATCH 4/4] problems restoring the history file are not signaled
correctly to the calling application
---
histfile.c | 2 ++
patchlevel | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/histfile.c b/histfile.c
index 6c3adc9..8eb3496 100644
--- a/histfile.c
+++ b/histfile.c
@@ -620,6 +620,7 @@ history_truncate_file (const char *fname, int lines)
if (rv != 0)
{
+ rv = errno;
if (tempname)
unlink (tempname);
history_lines_written_to_file = 0;
@@ -767,6 +768,7 @@ mmap_error:
if (rv != 0)
{
+ rv = errno;
if (tempname)
unlink (tempname);
history_lines_written_to_file = 0;
diff --git a/patchlevel b/patchlevel
index ce3e355..626a945 100644
--- a/patchlevel
+++ b/patchlevel
@@ -1,3 +1,3 @@
# Do not edit -- exists only for use by patch
-3
+4
--
1.8.3.1

View File

@ -1,59 +0,0 @@
From f5720c8cabbdb2387b4dc9e36633a73df6a634da Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Fri, 7 Feb 2020 14:57:47 -0500
Subject: [PATCH 3/4] reading history entries with timestamps can result in
joined entries
---
histfile.c | 15 ++++++++++++++-
patchlevel | 2 +-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/histfile.c b/histfile.c
index a8a92aa..6c3adc9 100644
--- a/histfile.c
+++ b/histfile.c
@@ -369,9 +369,11 @@ read_history_range (const char *filename, int from, int to)
}
has_timestamps = HIST_TIMESTAMP_START (buffer);
- history_multiline_entries += has_timestamps && history_write_timestamps;
+ history_multiline_entries += has_timestamps && history_write_timestamps;
/* Skip lines until we are at FROM. */
+ if (has_timestamps)
+ last_ts = buffer;
for (line_start = line_end = buffer; line_end < bufend && current_line < from; line_end++)
if (*line_end == '\n')
{
@@ -380,7 +382,18 @@ read_history_range (const char *filename, int from, int to)
line. We should check more extensively here... */
if (HIST_TIMESTAMP_START(p) == 0)
current_line++;
+ else
+ last_ts = p;
line_start = p;
+ /* If we are at the last line (current_line == from) but we have
+ timestamps (has_timestamps), then line_start points to the
+ text of the last command, and we need to skip to its end. */
+ if (current_line >= from && has_timestamps)
+ {
+ for (line_end = p; line_end < bufend && *line_end != '\n'; line_end++)
+ ;
+ line_start = (*line_end == '\n') ? line_end + 1 : line_end;
+ }
}
/* If there are lines left to gobble, then gobble them now. */
diff --git a/patchlevel b/patchlevel
index 7cbda82..ce3e355 100644
--- a/patchlevel
+++ b/patchlevel
@@ -1,3 +1,3 @@
# Do not edit -- exists only for use by patch
-2
+3
--
1.8.3.1

View File

@ -22,11 +22,11 @@ index eb16211..3a34840 100644
# Since tilde.c is shared between readline and bash, make sure we compile
# it with the right flags when it's built as part of readline
diff --git a/support/shobj-conf b/support/shobj-conf
index 1f64433..40827a4 100644
index 5a3f977..e51f7c4 100644
--- a/support/shobj-conf
+++ b/support/shobj-conf
@@ -126,10 +126,11 @@ sunos5*|solaris2*)
linux*-*|gnu*-*|k*bsd*-gnu-*|freebsd*-gentoo)
linux*-*|gnu*-*|k*bsd*-gnu-*|freebsd*|dragonfly*)
SHOBJ_CFLAGS=-fPIC
SHOBJ_LD='${CC}'
- SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
@ -38,7 +38,6 @@ index 1f64433..40827a4 100644
+ SHLIB_LIBS='-ltinfo'
;;
freebsd2*)
# Darwin/MacOS X
--
1.9.3

Binary file not shown.

BIN
readline-8.1.tar.gz Normal file

Binary file not shown.

View File

@ -1,6 +1,6 @@
Name: readline
Version: 8.0
Release: 3
Version: 8.1
Release: 1
Summary: Readline library for editing typed command lines
License: GPLv3+
@ -8,10 +8,6 @@ URL: http://tiswww.case.edu/php/chet/readline/rltop.html
Source0: http://git.savannah.gnu.org/cgit/readline.git/snapshot/%{name}-%{version}.tar.gz
Patch0: readline-8.0-shlib.patch
Patch1: fix-file-descriptor-leak-with-z.patch
Patch2: fix-problems-moving-back-beyond-start-of-history.patch
Patch3: reading-history-entries-with-timestamps-can-result-i.patch
Patch4: problems-restoring-the-history-file-are-not-signaled.patch
BuildRequires: gcc gcc-c++ ncurses-devel
@ -83,6 +79,9 @@ export CPPFLAGS="-I%{_includedir}/ncurses"
%changelog
* Mon Sep 27 2021 yangzhuangzhuang <yangzhuangzhuang1@huawei.com> - 8.1-1
- update to 8.1
* Thu Jun 24 2021 yangzhuangzhuang <yangzhuangzhuang1@huawei.com> - 8.0-3
- Delete useless old version dynamic library