mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-01-19 00:09:37 +03:00
app-shells/bash: add 5.2_p37-r3 to rectify the misapplication of a backported fix
While backporting commit e327891b52513bef0b34aac625c44f8fa6811f53 from
the devel branch, I accidentally left in a line that should have been
removed, resulting in bash occasionally segfaulting while using the -e
option of the read builtin. Address that mistake.
Additionally, correct a typo in the commit message of one of the other
patches ("incoprorate" > "incorporate").
Fixes: 0193ee11e3
Signed-off-by: Kerin Millar <kfm@plushkava.net>
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From 57fbf1c67f2d89365601f39e72781fba001fe2f3 Mon Sep 17 00:00:00 2001
|
||||
From 01463f6ae5a58b7309769596714e76b0d265b622 Mon Sep 17 00:00:00 2001
|
||||
From: Kerin Millar <kfm@plushkava.net>
|
||||
Date: Mon, 28 Apr 2025 08:13:38 +0100
|
||||
Subject: [PATCH 3/3] Backport fix for erroneous delimiter pushback condition
|
||||
@@ -23,7 +23,7 @@ $'\315'
|
||||
''
|
||||
''
|
||||
|
||||
With the upcoming 5.3-rc2, which will incoprorate this patch, all three
|
||||
With the upcoming 5.3-rc2, which will incorporate this patch, all three
|
||||
records are read correctly.
|
||||
|
||||
<FOO>
|
||||
@@ -47,7 +47,7 @@ Signed-off-by: Kerin Millar <kfm@plushkava.net>
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git builtins/read.def builtins/read.def
|
||||
index 9fd9a74c..8000def3 100644
|
||||
index 48351c3c..70a3508b 100644
|
||||
--- builtins/read.def
|
||||
+++ builtins/read.def
|
||||
@@ -1102,14 +1102,14 @@ read_mbchar (fd, string, ind, ch, delim, unbuffered)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From fb31e1965baa732f9e4cdbe3a7d6691d7beb4e03 Mon Sep 17 00:00:00 2001
|
||||
From c87aca06c259b6283a499584d95c87f163accba0 Mon Sep 17 00:00:00 2001
|
||||
From: Kerin Millar <kfm@plushkava.net>
|
||||
Date: Mon, 28 Apr 2025 07:59:25 +0100
|
||||
Subject: [PATCH 2/3] Backport fix for invalid continuation bytes above 0x7F
|
||||
@@ -26,11 +26,11 @@ Link: https://mywiki.wooledge.org/BashPitfalls#IFS.3D_read_-r_-d_.27.27_filename
|
||||
Link: https://lists.gnu.org/r/bug-bash/2024-08/msg00100.html
|
||||
Signed-off-by: Kerin Millar <kfm@plushkava.net>
|
||||
---
|
||||
builtins/read.def | 40 +++++++++++++++++++++++-----------------
|
||||
1 file changed, 23 insertions(+), 17 deletions(-)
|
||||
builtins/read.def | 41 +++++++++++++++++++++++------------------
|
||||
1 file changed, 23 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git builtins/read.def builtins/read.def
|
||||
index 53b4bd81..9fd9a74c 100644
|
||||
index 53b4bd81..48351c3c 100644
|
||||
--- builtins/read.def
|
||||
+++ builtins/read.def
|
||||
@@ -142,7 +142,7 @@ sh_timer *read_timeout;
|
||||
@@ -80,16 +80,17 @@ index 53b4bd81..9fd9a74c 100644
|
||||
mbchar[--i] = '\0'; /* unget the delimiter */
|
||||
}
|
||||
break; /* invalid multibyte character */
|
||||
@@ -1220,6 +1219,8 @@ edit_line (p, itext)
|
||||
@@ -1219,7 +1218,8 @@ edit_line (p, itext)
|
||||
|
||||
len = strlen (ret);
|
||||
ret = (char *)xrealloc (ret, len + 2);
|
||||
ret[len++] = delim;
|
||||
- ret[len++] = delim;
|
||||
+ if (delim > 0)
|
||||
+ ret[len++] = delim;
|
||||
ret[len] = '\0';
|
||||
return ret;
|
||||
}
|
||||
@@ -1240,7 +1241,7 @@ static rl_command_func_t *old_delim_func;
|
||||
@@ -1240,7 +1240,7 @@ static rl_command_func_t *old_delim_func;
|
||||
static int old_newline_ctype;
|
||||
static rl_command_func_t *old_newline_func;
|
||||
|
||||
@@ -98,7 +99,7 @@ index 53b4bd81..9fd9a74c 100644
|
||||
|
||||
static void
|
||||
set_eol_delim (c)
|
||||
@@ -1252,19 +1253,21 @@ set_eol_delim (c)
|
||||
@@ -1252,19 +1252,21 @@ set_eol_delim (c)
|
||||
initialize_readline ();
|
||||
cmap = rl_get_keymap ();
|
||||
|
||||
@@ -128,7 +129,7 @@ index 53b4bd81..9fd9a74c 100644
|
||||
|
||||
delim_char = c;
|
||||
}
|
||||
@@ -1280,7 +1283,10 @@ reset_eol_delim (cp)
|
||||
@@ -1280,7 +1282,10 @@ reset_eol_delim (cp)
|
||||
cmap[RETURN].type = old_newline_ctype;
|
||||
cmap[RETURN].function = old_newline_func;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user