Commit | Line | Data |
---|---|---|
78a9a250 MB |
1 | Fix compatibility with newer Perls. |
2 | ||
3 | The first patch is taken from upstream: | |
4 | https://svn.savannah.gnu.org/viewvc/texinfo?view=revision&revision=8008 | |
5 | ||
6 | The second gets rid of a deprecation warning that breaks some tests. | |
7 | Taken from Fedora: <https://bugzilla.redhat.com/show_bug.cgi?id=1590308>. | |
8 | ||
9 | --- trunk/tp/Texinfo/Convert/XSParagraph/xspara.c 2017/04/30 14:57:26 7765 | |
10 | +++ trunk/tp/Texinfo/Convert/XSParagraph/xspara.c 2018/07/13 15:39:29 8008 | |
11 | @@ -248,6 +248,11 @@ | |
12 | ||
13 | dTHX; | |
14 | ||
15 | +#if PERL_VERSION > 27 || (PERL_VERSION == 27 && PERL_SUBVERSION > 8) | |
16 | + /* needed due to thread-safe locale handling in newer perls */ | |
17 | + switch_to_global_locale(); | |
18 | +#endif | |
19 | + | |
20 | if (setlocale (LC_CTYPE, "en_US.UTF-8") | |
21 | || setlocale (LC_CTYPE, "en_US.utf8")) | |
22 | goto success; | |
23 | @@ -320,6 +325,10 @@ | |
24 | { | |
25 | success: ; | |
26 | free (utf8_locale); | |
27 | +#if PERL_VERSION > 27 || (PERL_VERSION == 27 && PERL_SUBVERSION > 8) | |
28 | + /* needed due to thread-safe locale handling in newer perls */ | |
29 | + sync_locale(); | |
30 | +#endif | |
31 | /* | |
32 | fprintf (stderr, "tried to set LC_CTYPE to UTF-8.\n"); | |
33 | fprintf (stderr, "character encoding is: %s\n", | |
34 | ||
35 | diff -up texinfo-6.5/tp/Texinfo/Parser.pm.orig texinfo-6.5/tp/Texinfo/Parser.pm | |
36 | --- texinfo-6.5/tp/Texinfo/Parser.pm.orig 2018-06-12 13:40:29.356030136 +0200 | |
37 | +++ texinfo-6.5/tp/Texinfo/Parser.pm 2018-06-12 13:41:28.357725639 +0200 | |
38 | @@ -5478,11 +5478,11 @@ sub _parse_special_misc_command($$$$) | |
39 | } | |
40 | } elsif ($command eq 'clickstyle') { | |
41 | # REMACRO | |
42 | - if ($line =~ /^\s+@([[:alnum:]][[:alnum:]\-]*)({})?\s*/) { | |
43 | + if ($line =~ /^\s+@([[:alnum:]][[:alnum:]\-]*)(\{})?\s*/) { | |
44 | $args = ['@'.$1]; | |
45 | $self->{'clickstyle'} = $1; | |
46 | $remaining = $line; | |
47 | - $remaining =~ s/^\s+@([[:alnum:]][[:alnum:]\-]*)({})?\s*(\@(c|comment)((\@|\s+).*)?)?//; | |
48 | + $remaining =~ s/^\s+@([[:alnum:]][[:alnum:]\-]*)(\{})?\s*(\@(c|comment)((\@|\s+).*)?)?//; | |
49 | $has_comment = 1 if (defined($4)); | |
50 | } else { | |
51 | $self->line_error (sprintf($self->__( |