Since revision 11344 the preference parser (TWiki::Prefs::Parser.pm)
adds useless spaces to the end of a value where it shouldn't because of this change:
- } elsif( $type ) {
- if( $line =~ /^(\s{3}|\t)+\s*[^\s*]/ &&
- $line !~ m/$TWiki::regex{bulletRegex}/o ) {
+ } elsif( defined $type ) {
+ if( /^( |\t)+ */ && !/$TWiki::regex{bulletRegex}/o ) {
This code fragment analyzes the line after a preference setting and
tries to decide if it is to be appended to the value or not like in
* Set A_VAR = foo
bar
sets A_VAR to
foo
bar
The problem with the new regex
/^( |\t)+ */
is that it matches
a continued value only consisting of spaces. So
* Set B_VAR =
<space><space><space>
does
not set B_VAR to the empty string but to
\n
<space><space><space>
... which is a bad way to be "white-space-sensitive".
The fix would be to check (as the original regex did) that there is
at least one non-white-space following:
--- lib/TWiki/Prefs/Parser.pm (revision 11375)
+++ lib/TWiki/Prefs/Parser.pm (working copy)
@@ -75,7 +75,7 @@
$key = $2;
$value = (defined $3) ? $3 : '';
} elsif( defined $type ) {
- if( /^( |\t)+ */ && !/$TWiki::regex{bulletRegex}/o ) {
+ if( /^( |\t)+ *[^\s]/ && !/$TWiki::regex{bulletRegex}/o ) {
# follow up line, extending value
$value .= "\n".$_;
} else {
CDot, as you've done the last checkin in that area, do you agree?
MD
Closed in 4.0.5
KJL