summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2013-11-25 19:37:05 +0100
committerSven Eden <yamakuzure@gmx.net>2013-11-25 19:37:05 +0100
commit5762ce745351658babc388cd62a7f9ed5dfcb5c3 (patch)
tree704c1221c59b27b22a783d3e4b7dc1a7bef924cd /ufed.pl.in
parentufed.pl/Portage.pm: Parsing error messages from eval are now chomp'ed (diff)
downloadufed-5762ce745351658babc388cd62a7f9ed5dfcb5c3.tar.gz
ufed-5762ce745351658babc388cd62a7f9ed5dfcb5c3.tar.bz2
ufed-5762ce745351658babc388cd62a7f9ed5dfcb5c3.zip
Extended the regular expressions used to parse found files following
a hint I got from perlmonks.
Diffstat (limited to 'ufed.pl.in')
-rw-r--r--ufed.pl.in31
1 files changed, 26 insertions, 5 deletions
diff --git a/ufed.pl.in b/ufed.pl.in
index 3d1e354..17f4c7a 100644
--- a/ufed.pl.in
+++ b/ufed.pl.in
@@ -177,11 +177,32 @@ sub save_flags {
\#.*)+}x;
my $IDENT = qr{([^ \\\n\t'"{}=#]+)}; # identifiers
my $ASSIG = qr{=}; # assignment operator
- my $UQVAL = qr{(?:[^ \\\n\t'"#]+|\\.)+}s; # unquoted value
- my $SQVAL = qr{'[^']*'}; # singlequoted value
- my $DQVAL = qr{"(?:[^\\"]|\\.)*"}s; # doublequoted value
- my $BNUQV = qr{(?:[^ \\\n\t'"#]+|\\\n()|\\.)+}s;# unquoted value (scan for \\\n)
- my $BNDQV = qr{"(?:[^\\"]|\\\n()|\\.)*"}s; # doublequoted value (scan for \\\n)
+ my $UQVAL = qr{(?: # guard to extend the character limit
+ [^ \\\n\t'"#]{1,32766} | # max 32766 of regular characters or
+ \\. # one escaped character
+ ){1,32766} # extend by 32766 sub matches
+ }sx; # unquoted value
+ my $SQVAL = qr{'(?: # guard to extend the character limit
+ [^']{0,32766} # 0 to 32766 characters ...
+ ){0,32766} # ... up to 32766 times
+ '}x; # singlequoted value
+ my $DQVAL = qr{"(?: # guard to extend the character limit
+ [^\\"]{0,32766} | # max 32766 non-escaped characters or
+ \\. # one escaped character
+ ){0,32766} # extend by up to 32766 sub matches
+ "}sx; # doublequoted value
+ my $BNUQV = qr{(?:
+ [^ \\\n\t'"#]{1,32766} | # Anything but escapes, quotes and so on
+ \\\n() | # or a backslash followed by a newline
+ \\. # or any other escape sequence
+ ){1,32766} # extended like above
+ }sx; # unquoted value (scan for \\\n)
+ my $BNDQV = qr{"(?:(?: # double guard to extend more freely
+ [^\\"] | # Anything but a backslash or double quote
+ \\\n() | # or a backslash and a newline
+ \\. # or any other escaped value
+ ){0,32766}){0,32766} # max 32766*32766 matches.
+ "}sx; # doublequoted value (scan for \\\n)
my $contents;