summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2022-10-05 10:41:16 -0400
committerChet Ramey <chet.ramey@case.edu>2022-10-05 10:41:16 -0400
commit7274faabe97ce53d6b464272d7e6ab6c1392837b (patch)
tree1ac73870f0a104c5645f2a9666b0176249006d9f
parentf7a382fd09319b20ef4435b9b554183b605468c1 (diff)
downloadreadline-7274faabe97ce53d6b464272d7e6ab6c1392837b.tar.gz
Readline-8.2 patch 1: fix crash when readline is started with an invalid locale specificationHEADmaster
-rw-r--r--._.gitignorebin4096 -> 0 bytes
-rw-r--r--nls.c4
-rw-r--r--patchlevel2
3 files changed, 5 insertions, 1 deletions
diff --git a/._.gitignore b/._.gitignore
deleted file mode 100644
index aa90ec6..0000000
--- a/._.gitignore
+++ /dev/null
Binary files differ
diff --git a/nls.c b/nls.c
index 5c6a13b..8c027d6 100644
--- 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
diff --git a/patchlevel b/patchlevel
index d8c9df7..fdf4740 100644
--- a/patchlevel
+++ b/patchlevel
@@ -1,3 +1,3 @@
# Do not edit -- exists only for use by patch
-0
+1