projects
/
matthijs
/
upstream
/
blosxom-plugins.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5576fc5
)
Treat undefined variables as empty string in tests.
author
Matthijs Kooijman
<matthijs@stdin.nl>
Mon, 4 Jan 2010 19:54:32 +0000
(20:54 +0100)
committer
Matthijs Kooijman
<matthijs@stdin.nl>
Mon, 4 Jan 2010 20:01:52 +0000
(21:01 +0100)
This prevents warnings when using comparison attributes together with
variables that are undefined.
general/interpolate_fancy
patch
|
blob
|
history
diff --git
a/general/interpolate_fancy
b/general/interpolate_fancy
index c4557698c18a740220a1f35ed99be4668e1d4ab5..4b8b759777373a01aa5093a56b6d6b4151caeb2e 100644
(file)
--- a/
general/interpolate_fancy
+++ b/
general/interpolate_fancy
@@
-155,6
+155,11
@@
sub do_interpolate {
sub _test {
my($variable, $attr) = @_;
+ # If the variable is not defined, treat it as the empty string in
+ # comparisons below
+ if (!defined $variable) {
+ $variable = '';
+ }
my $attributes = interpolate_fancy::_attributes($attr);
defined $attributes->{eq} and return $variable eq $attributes->{eq};