5 Patch-ID: readline82-001
7 Bug-Reported-by: Kan-Ru Chen <koster@debian.org>
9 Bug-Reference-URL: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021109
13 Starting a readline application with an invalid locale specification for
14 LC_ALL/LANG/LC_CTYPE can cause it crash on the first call to readline.
16 Patch (apply with `patch -p0'):
18 *** ../readline-8.2-patched/nls.c 2022-08-15 09:38:51.000000000 -0400
19 --- nls.c 2022-10-05 09:23:22.000000000 -0400
24 ret = setlocale (LC_CTYPE, lspec); /* ok, since it does not change locale */
25 + if (ret == 0 || *ret == 0)
26 + ret = setlocale (LC_CTYPE, (char *)NULL);
27 + if (ret == 0 || *ret == 0)
28 + ret = RL_DEFAULT_LOCALE;
30 ret = (lspec == 0 || *lspec == 0) ? RL_DEFAULT_LOCALE : lspec;
32 *** ../readline-8.2/patchlevel 2013-11-15 08:11:11.000000000 -0500
33 --- patchlevel 2014-03-21 08:28:40.000000000 -0400
36 # Do not edit -- exists only for use by patch
40 # Do not edit -- exists only for use by patch