improve fix to DTRT for a param of "0"

master
Joey Hess 2008-08-04 14:58:21 -04:00
parent 86674c9584
commit 6f2d1536b8
1 changed files with 4 additions and 3 deletions

View File

@ -1043,7 +1043,9 @@ sub preprocess ($$$;$$) { #{{{
my $prefix=shift; my $prefix=shift;
my $command=shift; my $command=shift;
my $params=shift; my $params=shift;
if (length $escape) { $params="" if ! defined $params;
f (length $escape) {
return "[[$prefix$command $params]]"; return "[[$prefix$command $params]]";
} }
elsif (exists $hooks{preprocess}{$command}) { elsif (exists $hooks{preprocess}{$command}) {
@ -1176,8 +1178,7 @@ sub preprocess ($$$;$$) { #{{{
}sx; }sx;
} }
# $4 can be undef if the directive was [[!foo]] $content =~ s{$regex}{$handle->($1, $2, $3, $4)}eg;
$content =~ s{$regex}{$handle->($1, $2, $3, ($4 or ""))}eg;
return $content; return $content;
} #}}} } #}}}