]> git.ipfire.org Git - ipfire-3.x.git/blob - readline/patches/readline-8.2-patch-1.patch
readline: Actually add patch that fixes the crash
[ipfire-3.x.git] / readline / patches / readline-8.2-patch-1.patch
1 From 7274faabe97ce53d6b464272d7e6ab6c1392837b Mon Sep 17 00:00:00 2001
2 From: Chet Ramey <chet.ramey@case.edu>
3 Date: Wed, 5 Oct 2022 10:41:16 -0400
4 Subject: [PATCH] Readline-8.2 patch 1: fix crash when readline is started with
5 an invalid locale specification
6
7 diff --git a/nls.c b/nls.c
8 index 5c6a13b..8c027d6 100644
9 --- a/nls.c
10 +++ b/nls.c
11 @@ -141,6 +141,10 @@ _rl_init_locale (void)
12 if (lspec == 0)
13 lspec = "";
14 ret = setlocale (LC_CTYPE, lspec); /* ok, since it does not change locale */
15 + if (ret == 0 || *ret == 0)
16 + ret = setlocale (LC_CTYPE, (char *)NULL);
17 + if (ret == 0 || *ret == 0)
18 + ret = RL_DEFAULT_LOCALE;
19 #else
20 ret = (lspec == 0 || *lspec == 0) ? RL_DEFAULT_LOCALE : lspec;
21 #endif
22 diff --git a/patchlevel b/patchlevel
23 index d8c9df7..fdf4740 100644
24 --- a/patchlevel
25 +++ b/patchlevel
26 @@ -1,3 +1,3 @@
27 # Do not edit -- exists only for use by patch
28
29 -0
30 +1
31 --
32 2.30.2
33