r9341: fix case reading
[kmrcl.git] / web-utils.lisp
index 64f98176b3a286db11dcf8ca9b03a9b72cae3aa3..40cb04018bed71dfd1883a0c09880261a7eda2f3 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
-;;;; $Id: web-utils.lisp,v 1.15 2003/06/17 04:56:02 kevin Exp $
+;;;; $Id$
 ;;;;
 ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
@@ -89,7 +89,7 @@
   (declare (simple-string s)
           (optimize (speed 3) (safety 0) (space 0)))
   (do* ((old-len (length s))
-       (new-len (- old-len (* 2 (count-string-char s #\%))))
+       (new-len (- old-len (* 2 (the fixnum (count-string-char s #\%)))))
        (new (make-string new-len))
        (p-old 0)
        (p-new 0 (1+ p-new)))
             (t
              (setf (schar new p-new) c)
              (incf p-old))))))
+
+(defun split-uri-query-string (s)
+  (mapcar
+   (lambda (pair)
+     (let ((pos (position #\= pair)))
+       (when pos
+        (cons (subseq pair 0 pos)
+              (when (> (length pair) pos)
+                (decode-uri-query-string (subseq pair (1+ pos))))))))
+   (delimited-string-to-list s #\&)))