r9341: fix case reading
[kmrcl.git] / web-utils.lisp
index ab765d608920776fd000bd21ebc25742387b0d86..40cb04018bed71dfd1883a0c09880261a7eda2f3 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
-;;;; $Id: web-utils.lisp,v 1.14 2003/06/15 19:01:01 kevin Exp $
+;;;; $Id$
 ;;;;
 ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
@@ -27,7 +27,7 @@
 (defvar *standard-html-header* "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">")
 
 (defvar *standard-xhtml-header*
-  #.(format nil "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>~%<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11\">"))
+  #.(format nil "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>~%<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">"))
 
 
 ;;; User agent functions
@@ -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 #\&)))