summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/readline/readline/readline82-001.patch
blob: 4e9839db9c804b8113f324f9a0ca34482b28109e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
			   READLINE PATCH REPORT
			   =====================

Readline-Release: 8.2
Patch-ID: readline82-001

Bug-Reported-by:	Kan-Ru Chen <koster@debian.org>
Bug-Reference-ID:
Bug-Reference-URL:	https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021109

Bug-Description:

Starting a readline application with an invalid locale specification for
LC_ALL/LANG/LC_CTYPE can cause it crash on the first call to readline.

Patch (apply with `patch -p0'):

Upstream-Status: Submitted [https://ftp.gnu.org/gnu/readline/readline-8.2-patches/]
Signed-off-by: Khem Raj <raj.khem@gmail.com>

*** ../readline-8.2-patched/nls.c	2022-08-15 09:38:51.000000000 -0400
--- nls.c	2022-10-05 09:23:22.000000000 -0400
***************
*** 142,145 ****
--- 142,149 ----
      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;

*** ../readline-8.2/patchlevel	2013-11-15 08:11:11.000000000 -0500
--- patchlevel	2014-03-21 08:28:40.000000000 -0400
***************
*** 1,3 ****
  # Do not edit -- exists only for use by patch
  
! 0
--- 1,3 ----
  # Do not edit -- exists only for use by patch
  
! 1