r5514: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 18 Aug 2003 05:48:55 +0000 (05:48 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 18 Aug 2003 05:48:55 +0000 (05:48 +0000)
base.lisp
utils.lisp

index ebb2ece37c8932ef451c4a0d204444babd126e6c..5fc67e4974f55d4d56b443b3d17f321981ba4775 100644 (file)
--- a/base.lisp
+++ b/base.lisp
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Dec 2002
 ;;;;
-;;;; $Id: base.lisp,v 1.13 2003/07/16 20:40:43 kevin Exp $
+;;;; $Id: base.lisp,v 1.14 2003/08/18 05:48:55 kevin Exp $
 ;;;; *************************************************************************
 
 (in-package #:modlisp)
@@ -91,9 +91,7 @@
 
 (defun read-modlisp-header ()
   (loop for key = (read-modlisp-line)
-      while (and key
-                (string-not-equal key "end")
-                (> (length key) 1))
+      while (and key (string-not-equal key "end"))
       for value = (read-modlisp-line)
       collect (cons (ensure-keyword key) value)))
 
index 6720144665978563dd7cb2717493cad8fecaf2ff..ec42df6332429479e2994b18f666c3960903e149 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Dec 2002
 ;;;;
-;;;; $Id: utils.lisp,v 1.9 2003/08/10 17:56:44 kevin Exp $
+;;;; $Id: utils.lisp,v 1.10 2003/08/18 05:48:55 kevin Exp $
 ;;;; *************************************************************************
 
 (in-package #:modlisp)
@@ -90,7 +90,7 @@
 
 ;; Utility functions for library users
 
-(defun query-to-alist (posted-string)
+(defun query-to-alist (posted-string &key (keyword t))
   "Converts a posted string to an assoc list of keyword names and values,
 \"a=1&bc=demo\" => ((:a . \"1\") (:bc . \"demo\"))"
   (when posted-string
        (let ((name-val-list (kmrcl:delimited-string-to-list name=val #\=)))
          (if (= 2 (length name-val-list))
            (destructuring-bind (name val) name-val-list
-             (push (cons (kmrcl:ensure-keyword name)
+             (push (cons (if keyword
+                             (kmrcl:ensure-keyword name)
+                           name)
                          (kmrcl:decode-uri-query-string val))
                    alist))
            (cmsg-c :debug "Invalid number of #\= in ~S" name-val-list)))))))
+
+