]> git.ipfire.org Git - thirdparty/readline.git/commitdiff
Readline-8.2 patch 1: fix crash when readline is started with an invalid locale speci...
authorChet Ramey <chet.ramey@case.edu>
Wed, 5 Oct 2022 14:41:16 +0000 (10:41 -0400)
committerChet Ramey <chet.ramey@case.edu>
Wed, 5 Oct 2022 14:41:16 +0000 (10:41 -0400)
._.gitignore [deleted file]
nls.c
patchlevel

diff --git a/._.gitignore b/._.gitignore
deleted file mode 100644 (file)
index aa90ec6..0000000
Binary files a/._.gitignore and /dev/null differ
diff --git a/nls.c b/nls.c
index 5c6a13b6e9ce6687b72410cf29c399215aef0003..8c027d6be500d06d90a7549e70127c3ba16093a6 100644 (file)
--- 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
index d8c9df7e6bb19b63a7c7f1c4f192a91529e40699..fdf474049fce8501d87e7b8fa7cf2b72cab0ad9b 100644 (file)
@@ -1,3 +1,3 @@
 # Do not edit -- exists only for use by patch
 
-0
+1