]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
readline: Actually add patch that fixes the crash
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Jan 2023 13:35:24 +0000 (13:35 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Jan 2023 13:35:24 +0000 (13:35 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
readline/patches/readline-8.2-patch-1.patch [new file with mode: 0644]

diff --git a/readline/patches/readline-8.2-patch-1.patch b/readline/patches/readline-8.2-patch-1.patch
new file mode 100644 (file)
index 0000000..16a7d62
--- /dev/null
@@ -0,0 +1,33 @@
+From 7274faabe97ce53d6b464272d7e6ab6c1392837b Mon Sep 17 00:00:00 2001
+From: Chet Ramey <chet.ramey@case.edu>
+Date: Wed, 5 Oct 2022 10:41:16 -0400
+Subject: [PATCH] Readline-8.2 patch 1: fix crash when readline is started with
+ an invalid locale specification
+
+diff --git a/nls.c b/nls.c
+index 5c6a13b..8c027d6 100644
+--- a/nls.c
++++ b/nls.c
+@@ -141,6 +141,10 @@ _rl_init_locale (void)
+   if (lspec == 0)
+     lspec = "";
+   ret = setlocale (LC_CTYPE, lspec);  /* ok, since it does not change locale */
++  if (ret == 0 || *ret == 0)
++    ret = setlocale (LC_CTYPE, (char *)NULL);
++  if (ret == 0 || *ret == 0)
++    ret = RL_DEFAULT_LOCALE;
+ #else
+   ret = (lspec == 0 || *lspec == 0) ? RL_DEFAULT_LOCALE : lspec;
+ #endif
+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
+-- 
+2.30.2
+