aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/tools/misc/texinfo/perl.patch
blob: e651b37371c78a1c0527afd21aa1a72861fcd943 (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
Adapted from http://svn.savannah.gnu.org/viewvc/texinfo/
Author: gavin
--- trunk/tp/Texinfo/Parser.pm  2018-06-04 19:51:36 UTC (rev 8006)
+++ trunk/tp/Texinfo/Parser.pm  2018-07-13 15:31:28 UTC (rev 8007)
@@ -5531,11 +5531,11 @@
     }
   } elsif ($command eq 'clickstyle') {
     # REMACRO
-    if ($line =~ /^\s+@([[:alnum:]][[:alnum:]\-]*)({})?\s*/) {
+    if ($line =~ /^\s+@([[:alnum:]][[:alnum:]\-]*)(\{\})?\s*/) {
       $args = ['@'.$1];
       $self->{'clickstyle'} = $1;
       $remaining = $line;
-      $remaining =~ s/^\s+@([[:alnum:]][[:alnum:]\-]*)({})?\s*(\@(c|comment)((\@|\s+).*)?)?//;
+      $remaining =~ s/^\s+@([[:alnum:]][[:alnum:]\-]*)(\{\})?\s*(\@(c|comment)((\@|\s+).*)?)?//;
       $has_comment = 1 if (defined($4));
     } else {
       $self->line_error (sprintf($self->__(
--- trunk/tp/Texinfo/Convert/XSParagraph/xspara.c       2018-07-13 15:31:28 UTC (rev 8007)
+++ trunk/tp/Texinfo/Convert/XSParagraph/xspara.c       2018-07-13 15:39:29 UTC (rev 8008)
@@ -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;
@@ -320,6 +325,10 @@
     {
 success: ;
       free (utf8_locale);
+#if PERL_VERSION > 27 || (PERL_VERSION == 27 && PERL_SUBVERSION > 8)
+      /* needed due to thread-safe locale handling in newer perls */
+      sync_locale();
+#endif
       /*
       fprintf (stderr, "tried to set LC_CTYPE to UTF-8.\n");
       fprintf (stderr, "character encoding is: %s\n",