From edc8c2654f9d4dce4fe960d568e386086f15c685 Mon Sep 17 00:00:00 2001 From: Stelian Ionescu Date: Tue, 26 Dec 2006 15:59:47 +0100 Subject: [PATCH] Fixed parse-number-or-nil. --- sockets/common.lisp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sockets/common.lisp b/sockets/common.lisp index e1dc3c9..13dd367 100644 --- a/sockets/common.lisp +++ b/sockets/common.lisp @@ -37,14 +37,15 @@ (defun parse-number-or-nil (value &optional (type :any) (radix 10)) (let (parsed) - (when (stringp value) - (setf parsed - (ignore-errors (parse-integer value :radix radix - :junk-allowed nil)))) + (setf parsed + (if (stringp value) + (ignore-errors (parse-integer value :radix radix + :junk-allowed nil)) + value)) (if parsed ;; if it's a number and its type is ok return it (and (ecase type - (:any parsed) + (:any t) (:ub8 (typep parsed 'ub8)) (:ub16 (typep parsed 'ub16)) (:ub32 (typep parsed 'ub32))) -- 2.11.4.GIT