From 794047b219bd704e20ac5e4017ffab20c7c91760 Mon Sep 17 00:00:00 2001 From: Alfredo Beaumont Date: Wed, 24 Apr 2013 16:41:25 +0200 Subject: [PATCH] !parse-integer: handle leading whitespace --- ecmalisp.lisp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ecmalisp.lisp b/ecmalisp.lisp index cd93750..f70407f 100644 --- a/ecmalisp.lisp +++ b/ecmalisp.lisp @@ -1135,7 +1135,11 @@ (index 0) (size (length string)) (sign 1)) - (when (zerop size) (return (values nil 0))) + ;; Leading whitespace + (while (and (< index size) + (whitespacep (char string index))) + (incf index)) + (unless (< index size) (return (values nil 0))) ;; Optional sign (case (char string 0) (#\+ (incf index)) -- 1.7.10.4