Subject: | buf attribute insert parsing |
Date: | Tue, 8 Aug 2006 09:10:45 -0700 (PDT) |
To: | bug-XML-XSH2 [...] rt.cpan.org |
From: | tatu [...] tajuma.com |
Hello,
There is a bug in XSH2 when parsing attribute string in insert command. It
causes an infinite loop of "ignoring characters" messages scrolling down
the screen.
Here is how to reproduce:
$scratch> create e
/> insert attribute "foo=" into e
(Ctrl-C to get out), or
/> $value = ""
/> insert attribute { "foo=$value" } into e
Running version 2.0.2/0.12 (Revision: 2.2).
A quick fix for this is like, maybe a proper error message or treating the
missing value as "" would be more approriate.
--- Functions.pm.orig 2006-08-08 19:05:39.000000000 +0300
+++ Functions.pm 2006-08-08 19:06:14.000000000 +0300
@@ -3185,6 +3185,7 @@
}
} else {
$str=~/\G(\S*\s*)/gsco;
+ last if $1 == "";
print STDERR "ignoring characters $1\n";
}
}
Cheers,
tatu