From: Russ Tyndall Date: Thu, 7 Jul 2011 18:41:17 +0000 (-0400) Subject: fixed type-dec on substitute-string-for-char so that nil arg value returns nil as... X-Git-Tag: v6.0.0~4^2~1 X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=ab6923bf84f595fb61eb0107f97ce143ca92db57 fixed type-dec on substitute-string-for-char so that nil arg value returns nil as previously --- diff --git a/sql/utils.lisp b/sql/utils.lisp index 6e4230d..d5b31ed 100644 --- a/sql/utils.lisp +++ b/sql/utils.lisp @@ -125,15 +125,17 @@ (substitute-string-for-char s #\' "''")) (defun substitute-string-for-char (procstr match-char subst-str) -"Substitutes a string for a single matching character of a string" - (declare (type string procstr)) - (let ((pos (position match-char procstr))) - (if pos - (concatenate 'string - (subseq procstr 0 pos) subst-str - (substitute-string-for-char - (subseq procstr (1+ pos)) match-char subst-str)) - procstr))) + "Substitutes a string for a single matching character of a string" + (when procstr + (locally + (declare (type string procstr)) + (let ((pos (position match-char procstr))) + (if pos + (concatenate 'string + (subseq procstr 0 pos) subst-str + (substitute-string-for-char + (subseq procstr (1+ pos)) match-char subst-str)) + procstr))))) (defun position-char (char string start max)