X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Futils.lisp;fp=sql%2Futils.lisp;h=d5b31ed4fd1678862294132dfd7bee98e95c6ee8;hp=6e4230d84d94486d8448cc9c84f9c89839bd47e4;hb=ab6923bf84f595fb61eb0107f97ce143ca92db57;hpb=bab5e8056e3850cd9fb0582f73955aee5abf010b 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)