Item9840: SUBST removes everything after last match if there is a newline after the match
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
FilterPlugin does not handle replacement when the text after the last match contains newlines.
Take the following replacement
%STARTSUBST%{pattern="b" format="B"}abc
xyz%STOPSUBST%
The expected outcome is:
aBc
xyz
The real outcome is:
aB
The patch below would probably fix it:
--- Core.pm~ 2010-10-18 13:57:06.392634612 +0200
+++ Core.pm 2010-10-18 15:38:17.711511441 +0200
@@ -214,7 +214,7 @@
$hits--;
last if $theLimit > 0 && $hits <= 0;
}
- if ($text =~ /\G(.*)$/) {
+ if ($text =~ /\G(.*)$/s) {
$result .= $1;
}
}
--
ErikJohansson - 18 Oct 2010
Fix released in 2.04
--
MichaelDaum - 06 Apr 2011