Subject: | Fix prototype errors while lazy loading the module |
Sorry if I'm resubmitting this ticket, but cannot find it in the history and do not know if I forgot to submit it upstream or not.
This is a problem with perl522 when doing some lazy loading
of the module, where a syntax error will occur as the prototype for
_unmatched and _retError are not defined.
Simply avoid to define prototypes and use parens when required.
Subject: | 0001-Fix-prototype-errors-while-lazy-loading-the-module.patch |
From 75e216b34ad8125dc4646c28756ff3b2042c30c0 Mon Sep 17 00:00:00 2001
From: Nicolas Rochelemagne <rochelemagne@cpanel.net>
Date: Wed, 20 Jan 2016 16:05:54 -0600
Subject: [PATCH] Fix prototype errors while lazy loading the module
This is a problem with perl522 when doing some lazy loading of
the module, where a syntax error will occur as the prototype
for _unmatched and _retError are not defined.
Simply avoid to define prototypes and use parens when required.
diff --git a/lib/File/GlobMapper.pm b/lib/File/GlobMapper.pm
index 76d4bed..a96cf3e 100644
--- a/lib/File/GlobMapper.pm
+++ b/lib/File/GlobMapper.pm
@@ -149,7 +149,7 @@ sub _parseBit
if ($2 eq ',')
{
- return _unmatched "("
+ return _unmatched("(")
if $depth ;
$out .= '|';
@@ -160,7 +160,7 @@ sub _parseBit
}
elsif ($2 eq ')')
{
- return _unmatched ")"
+ return _unmatched(")")
if ! $depth ;
-- $depth ;
@@ -170,22 +170,22 @@ sub _parseBit
# TODO -- quotemeta & check no '/'
# TODO -- check for \] & other \ within the []
$string =~ s#(.*?\])##
- or return _unmatched "[" ;
+ or return _unmatched("[");
$out .= "$1)" ;
}
elsif ($2 eq ']')
{
- return _unmatched "]" ;
+ return _unmatched("]");
}
elsif ($2 eq '{' || $2 eq '}')
{
- return _retError "Nested {} not allowed" ;
+ return _retError("Nested {} not allowed");
}
}
$out .= quotemeta $string;
- return _unmatched "("
+ return _unmatched("(")
if $depth ;
return $out ;
@@ -219,7 +219,7 @@ sub _parseInputGlob
}
elsif ($2 eq ')')
{
- return _unmatched ")"
+ return _unmatched(")")
if ! $depth ;
-- $depth ;
@@ -229,16 +229,16 @@ sub _parseInputGlob
# TODO -- quotemeta & check no '/' or '(' or ')'
# TODO -- check for \] & other \ within the []
$string =~ s#(.*?\])##
- or return _unmatched "[";
+ or return _unmatched("[");
$out .= "$1)" ;
}
elsif ($2 eq ']')
{
- return _unmatched "]" ;
+ return _unmatched("]");
}
elsif ($2 eq '}')
{
- return _unmatched "}" ;
+ return _unmatched("}");
}
elsif ($2 eq '{')
{
@@ -248,7 +248,7 @@ sub _parseInputGlob
my $tmp ;
unless ( $string =~ s/(.*?)$noPreBS\}//)
{
- return _unmatched "{";
+ return _unmatched("{");
}
#$string =~ s#(.*?)\}##;
@@ -263,7 +263,7 @@ sub _parseInputGlob
}
}
- return _unmatched "("
+ return _unmatched("(")
if $depth ;
$out .= quotemeta $string ;
--
2.10.0