blob: 4e9839db9c804b8113f324f9a0ca34482b28109e [file] [log] [blame]
Patrick Williams03514f12024-04-05 07:04:11 -05001 READLINE PATCH REPORT
2 =====================
3
4Readline-Release: 8.2
5Patch-ID: readline82-001
6
7Bug-Reported-by: Kan-Ru Chen <koster@debian.org>
8Bug-Reference-ID:
9Bug-Reference-URL: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021109
10
11Bug-Description:
12
13Starting a readline application with an invalid locale specification for
14LC_ALL/LANG/LC_CTYPE can cause it crash on the first call to readline.
15
16Patch (apply with `patch -p0'):
17
18Upstream-Status: Submitted [https://ftp.gnu.org/gnu/readline/readline-8.2-patches/]
19Signed-off-by: Khem Raj <raj.khem@gmail.com>
20
21*** ../readline-8.2-patched/nls.c 2022-08-15 09:38:51.000000000 -0400
22--- nls.c 2022-10-05 09:23:22.000000000 -0400
23***************
24*** 142,145 ****
25--- 142,149 ----
26 lspec = "";
27 ret = setlocale (LC_CTYPE, lspec); /* ok, since it does not change locale */
28+ if (ret == 0 || *ret == 0)
29+ ret = setlocale (LC_CTYPE, (char *)NULL);
30+ if (ret == 0 || *ret == 0)
31+ ret = RL_DEFAULT_LOCALE;
32 #else
33 ret = (lspec == 0 || *lspec == 0) ? RL_DEFAULT_LOCALE : lspec;
34
35*** ../readline-8.2/patchlevel 2013-11-15 08:11:11.000000000 -0500
36--- patchlevel 2014-03-21 08:28:40.000000000 -0400
37***************
38*** 1,3 ****
39 # Do not edit -- exists only for use by patch
40
41! 0
42--- 1,3 ----
43 # Do not edit -- exists only for use by patch
44
45! 1