From b41e5947735097d12eb795f2d1dc9c79ff391aba Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Wed, 12 Mar 2014 20:07:51 -0400 Subject: Fix script test handling of empty scripts Previously an empty script would evaluate to OP_0 --- src/test/script_tests.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/test/script_tests.cpp') diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index dd1b61304..f9ca65653 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -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 -- cgit v1.2.3