[xml/sgml-commit] [linuxdoc-tools] 04/17: fmt_latex2e.pl: Handle perl 5.22 deprecation of unescaped left brace in regular expressions.

Agustín Martín Domingo agmartin at moszumanska.debian.org
Wed May 4 17:56:07 UTC 2016


This is an automated email from the git hooks/post-receive script.

agmartin pushed a commit to branch upstream
in repository linuxdoc-tools.

commit cd05ec78c8374980362347a226d9c0cc5f6bb624
Author: Agustin Martin Domingo <agmartin at debian.org>
Date:   Tue Apr 5 18:43:13 2016 +0200

    fmt_latex2e.pl: Handle perl 5.22 deprecation of unescaped left brace in regular expressions.
    
    This is to deal with new perl 5.22 warnings like
    
     Unescaped left brace in regex is deprecated, passed through in regex;
     marked by <-- HERE in m/\\nameurl{ <-- HERE (.*)}{(.*)}/
     at /usr/share/linuxdoc-tools/fmt/fmt_latex2e.pl line 287.
    
    For consistency, right brackets are also escaped, although they
    currently don't trigger any warning.
    
    Signed-off-by: Agustin Martin Domingo <agmartin at debian.org>
---
 lib/fmt/fmt_latex2e.pl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/fmt/fmt_latex2e.pl b/lib/fmt/fmt_latex2e.pl
index 050cf06..69d8e62 100644
--- a/lib/fmt/fmt_latex2e.pl
+++ b/lib/fmt/fmt_latex2e.pl
@@ -284,11 +284,11 @@ $latex2e->{postASP} = sub
       push @texlines, $_;
       # and check for nameurl
       if ( /\\nameurl/ ){
-	($urlid, $urlnam) = ($_ =~ /\\nameurl{(.*)}{(.*)}/);
+	($urlid, $urlnam) = ($_ =~ /\\nameurl\{(.*)\}\{(.*)\}/);
 	print $urlnum . ": " . $urlid . "\n" if ( $global->{debug} );
 
 	$urldef = latex2e_defnam($urlnum) . "url";
-	s/\\nameurl{.*}{.*}/{\\em $urlnam} {\\tt \\$urldef}/;
+	s/\\nameurl\{.*\}\{.*\}/{\\em $urlnam} {\\tt \\$urldef}/;
 	push @urlnames, $_;
 	push @urldefines, "\\urldef{\\$urldef} \\url{$urlid}\n";
 	$urlnum++;
@@ -367,12 +367,12 @@ $latex2e->{postASP} = sub
 	    $_ = $_ . "\\makeindex\n" if ($latex2e->{makeindex});
 	  }
 	  # Set correct DTD name
-	  elsif (/^\\usepackage{\@LINUXDOC_DTD\@-sgml}/) {
+	  elsif (/^\\usepackage\{\@LINUXDOC_DTD\@-sgml\}/) {
 	    my $dtd = $global->{"dtd"};
 	    s/\@LINUXDOC_DTD\@/$dtd/;
 	  }
 	  # Set correct babel options
-	  elsif (/^\\usepackage\[\@BABELOPTIONS\@\]{babel}/) {
+	  elsif (/^\\usepackage\[\@BABELOPTIONS\@\]\{babel\}/) {
 	    if ( $babeloptions ) {
 	      s/\@BABELOPTIONS\@/$babeloptions/;
 	    } else {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-xml-sgml/linuxdoc-tools.git



More information about the debian-xml-sgml-commit mailing list