1
0
Fork 0
frozenports/devel/readline/files/readline-8.2-upstream_fix-1...

31 lines
1.2 KiB
Diff

Submitted By: Bruce Dubbs <bdubbs@linuxfromscratch.org>
Date: 2021-10-12
Initial Package Version: 8.2
Upstream Status: Applied
Origin: Upstream release repository
Starting a readline applications with an invalid locale
specification for LC_ALL/LANG/LC_CTYPE can cause the shell
to crash.
diff -Naur readline-8.2-orig/nls.c readline-8.2/nls.c
--- readline-8.2-orig/nls.c 2022-08-15 08:38:51.000000000 -0500
+++ readline-8.2/nls.c 2022-10-12 19:51:35.881738300 -0500
@@ -141,6 +141,10 @@
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 -Naur readline-8.2-orig/patchlevel readline-8.2/patchlevel
--- readline-8.2-orig/patchlevel 2020-05-21 13:22:40.000000000 -0500
+++ readline-8.2/patchlevel 2022-10-12 19:51:35.881738300 -0500
@@ -1,3 +1,3 @@
# Do not edit -- exists only for use by patch
-0
+1