From 1956393a44b981ef722dc1eab0264c4f714a81a6 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 10 Mar 2012 21:34:37 -0600 Subject: Allow conversion of negative values with int() --- src/value.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/value.cc') diff --git a/src/value.cc b/src/value.cc index 87b31cd6..97328c37 100644 --- a/src/value.cc +++ b/src/value.cc @@ -1228,7 +1228,7 @@ void value_t::in_place_cast(type_t cast_type) case STRING: switch (cast_type) { case INTEGER: { - if (all(as_string(), is_digit())) { + if (all(as_string(), is_any_of("-0123456789"))) { set_long(lexical_cast(as_string())); return; } -- cgit v1.2.3