From 3ab8ec401f85171db4ce2e249d4da157bbf5ec5e Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 17 Nov 2016 23:19:13 +0000 Subject: [PATCH] Issue #136 - trailing whitespace in string->number Allow trailing whitespace, which allows us to accept a wider range of input. --- runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime.c b/runtime.c index b8bacf05..78210cd1 100644 --- a/runtime.c +++ b/runtime.c @@ -1719,7 +1719,7 @@ object Cyc_string2number_(void *data, object cont, object str) } else { char *str_end; n = strtold(s, &str_end); - if (s != str_end && *str_end == '\0') { + if (s != str_end && (*str_end == '\0' || isspace(*str_end))) { make_double(result, n); _return_closcall1(data, cont, &result); } else {