mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Fix script test handling of empty scripts
Previously an empty script would evaluate to OP_0
This commit is contained in:
parent
ca0b8acbf3
commit
b41e594773
3 changed files with 27 additions and 1 deletions
|
|
@ -63,7 +63,11 @@ ParseScript(string s)
|
|||
|
||||
BOOST_FOREACH(string w, words)
|
||||
{
|
||||
if (all(w, is_digit()) ||
|
||||
if (w.size() == 0)
|
||||
{
|
||||
// Empty string, ignore. (boost::split given '' will return one word)
|
||||
}
|
||||
else if (all(w, is_digit()) ||
|
||||
(starts_with(w, "-") && all(string(w.begin()+1, w.end()), is_digit())))
|
||||
{
|
||||
// Number
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue