From c516d36f87ec7fa753d622aba0cf960e38caeedf Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" Date: Sat, 9 Oct 2010 11:34:36 +0000 Subject: [PATCH] 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 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/t/008filter.t | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index 43a218e5a02..ae9aba985b5 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -7524 \ No newline at end of file +7525 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/t/008filter.t b/mozilla/webtools/bugzilla/t/008filter.t index 0c38380df1c..c0ee3b1314b 100644 --- a/mozilla/webtools/bugzilla/t/008filter.t +++ b/mozilla/webtools/bugzilla/t/008filter.t @@ -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 '';