spack/var/spack/repos/builtin/packages/texinfo/update_locale_handling.patch
t-karatsu 49b9365205 texinfo: fix unescaped braces, and update locale handling (#13815)
* texinfo: Fix unescaped braces for older version.

* texinfo: update locale handling.
2019-11-20 20:54:55 -07:00

26 lines
819 B
Diff

--- spack-src/tp/Texinfo/Convert/XSParagraph/xspara.c.org 2019-11-18 17:33:07.717005871 +0900
+++ spack-src/tp/Texinfo/Convert/XSParagraph/xspara.c 2019-11-18 17:34:56.318436594 +0900
@@ -248,6 +248,11 @@
dTHX;
+#if PERL_VERSION > 27 || (PERL_VERSION == 27 && PERL_SUBVERSION > 8)
+ /* needed due to thread-safe locale handling in newer perls */
+ switch_to_global_locale();
+#endif
+
if (setlocale (LC_CTYPE, "en_US.UTF-8")
|| setlocale (LC_CTYPE, "en_US.utf8"))
goto success;
@@ -319,6 +324,10 @@
else
{
success: ;
+#if PERL_VERSION > 27 || (PERL_VERSION == 27 && PERL_SUBVERSION > 8)
+ /* needed due to thread-safe locale handling in newer perls */
+ sync_locale();
+#endif
free (utf8_locale);
/*
fprintf (stderr, "tried to set LC_CTYPE to UTF-8.\n");