From 49f84ccd7347606524722e1c064027bb7c96c3a6 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Mon, 18 Aug 2003 05:48:55 +0000 Subject: [PATCH] r5514: *** empty log message *** --- base.lisp | 6 ++---- utils.lisp | 10 +++++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/base.lisp b/base.lisp index ebb2ece..5fc67e4 100644 --- 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))) diff --git a/utils.lisp b/utils.lisp index 6720144..ec42df6 100644 --- a/utils.lisp +++ b/utils.lisp @@ -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 @@ -100,7 +100,11 @@ (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))))))) + + -- 2.34.1