X-Git-Url: http://git.kpe.io/?p=cl-modlisp.git;a=blobdiff_plain;f=utils.lisp;fp=utils.lisp;h=ec42df6332429479e2994b18f666c3960903e149;hp=6720144665978563dd7cb2717493cad8fecaf2ff;hb=49f84ccd7347606524722e1c064027bb7c96c3a6;hpb=e62a511f8a23b53b8e9e002c1b0c759bfff75390 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))))))) + +