From ab6923bf84f595fb61eb0107f97ce143ca92db57 Mon Sep 17 00:00:00 2001 From: Russ Tyndall Date: Thu, 7 Jul 2011 14:41:17 -0400 Subject: [PATCH] fixed type-dec on substitute-string-for-char so that nil arg value returns nil as previously --- sql/utils.lisp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) 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) -- 2.34.1