Bug 602832: 008filter.t doesn't catch [%~ ~%] correctly

r/a=mkanat


git-svn-id: svn://10.0.0.236/trunk@261369 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkanat%bugzilla.org
2010-10-09 11:34:36 +00:00
parent fc7e7d0788
commit c516d36f87
2 changed files with 6 additions and 6 deletions

View File

@@ -1 +1 @@
7524
7525

View File

@@ -110,7 +110,7 @@ foreach my $path (@Support::Templates::include_paths) {
# /g means we execute this loop for every match
# /s means we ignore linefeeds in the regexp matches
while ($slurp =~ /\[%(.*?)%\]/gs) {
while ($slurp =~ /\[%(?:-|\+|~)?(.*?)(?:-|\+|~)?%\]/gs) {
my $directive = $1;
my @lineno = ($` =~ m/\n/gs);
@@ -155,11 +155,11 @@ sub directive_ok {
my ($file, $directive) = @_;
# Comments
return 1 if $directive =~ /^[+-]?#/;
return 1 if $directive =~ /^#/;
# Remove any leading/trailing + or - and whitespace.
$directive =~ s/^[+-]?\s*//;
$directive =~ s/\s*[+-]?$//;
# Remove any leading/trailing whitespace.
$directive =~ s/^\s*//;
$directive =~ s/\s*$//;
# Empty directives are ok; they are usually line break helpers
return 1 if $directive eq '';