tcl-mod_dtcl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject cvs commit: tcl-moddtcl mod_dtcl.c
Date Tue, 08 May 2001 10:32:37 GMT
davidw      01/05/08 03:32:36

  Modified:    .        mod_dtcl.c
  Log:
  Re-added CGI variable - list making stuff.
  
  Revision  Changes    Path
  1.27      +18 -6     tcl-moddtcl/mod_dtcl.c
  
  Index: mod_dtcl.c
  ===================================================================
  RCS file: /home/cvs/tcl-moddtcl/mod_dtcl.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- mod_dtcl.c	2001/05/01 15:56:01	1.26
  +++ mod_dtcl.c	2001/05/08 10:32:28	1.27
  @@ -58,7 +58,7 @@
    * University of Illinois, Urbana-Champaign.
    */
   
  -/* $Id: mod_dtcl.c,v 1.26 2001/05/01 15:56:01 davidw Exp $  */
  +/* $Id: mod_dtcl.c,v 1.27 2001/05/08 10:32:28 davidw Exp $  */
   
   /* mod_dtcl.c by David Welton <davidw@apache.org> - originally mod_include.  */
   /* See http://tcl.apache.org/mod_dtcl/credits.ttml for additional credits. */
  @@ -741,11 +741,23 @@
   	{
   	    if (!parms[i].key)
   		continue;
  -
  -	    Tcl_ObjSetVar2(interp, varsobj, 
  -			   STRING_TO_UTF_TO_OBJ(parms[i].key),
  -			   STRING_TO_UTF_TO_OBJ(parms[i].val),
  -			   0);
  +	    else {
  +		/* All this is so that a query like x=1&x=2&x=3 will
  +                   produce a variable that is a list */
  +		Tcl_Obj *newkey = STRING_TO_UTF_TO_OBJ(parms[i].key);
  +		Tcl_Obj *newval = STRING_TO_UTF_TO_OBJ(parms[i].val);
  +		Tcl_Obj *oldkey = Tcl_ObjGetVar2(interp, varsobj, newkey, 0);
  +		
  +		if (oldkey == NULL)
  +		{
  +		    Tcl_ObjSetVar2(interp, varsobj, newkey, newval, 0);
  +		} else {
  +		    Tcl_Obj *concat[2];
  +		    concat[0] = oldkey;
  +		    concat[1] = newval;
  +		    Tcl_ObjSetVar2(interp, varsobj, newkey, Tcl_ConcatObj(2, concat), 0);
  +		}
  +	    }
   	}
   	
       }
  
  
  

Mime
View raw message