tcl-mod_dtcl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@dedasys.com (David N. Welton)
Subject Re: var get bug
Date Wed, 13 Mar 2002 15:57:50 GMT
"yahalom emet" <yahalom@zvia.org.il> writes:

> Hello
> 
> when I do a var get on  variables that have similiar names the short one gets also the
value of the other:
> 
> <?
> set details [var get details]
> set detailsRemark [var get detailsRemark]
> hputs "details-$details \n"
> hputs "detailsRemark-$detailsRemark"
> ?>
> <body BGCOLOR="white" LEFTMARGIN=0 TOPMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0>
>   <form action="testget.ttml"  method=post>
>   details
>   <input name="details"  value="" size=20>
>   detailsRemark
>   <input name="detailsRemark"  value="" size=20>
>   <input type=submit>
>   </form>
>   </body>

Woops, you are right!  I'm embarassed.  Here is an immediate fix.


diff -u -r1.20 tcl_commands.c
--- tcl_commands.c      14 Nov 2001 14:50:36 -0000      1.20
+++ tcl_commands.c      13 Mar 2002 15:52:27 -0000
@@ -536,7 +536,9 @@
            on... */
        for (i = 0; i < parmsarray->nelts; ++i)
        {
-           if (!strncmp(key, StringToUtf(parms[i].key, POOL), strlen(key)))
+           if (!strncmp(key, StringToUtf(parms[i].key, POOL), 
+                        strlen(key) < strlen(parms[i].key) ? 
+                        strlen(parms[i].key) : strlen(key)))
            {
                /* The following makes sure that we get one string,
                    with no sub lists. */

This is being propagated through CVS and will soon appear on the web
site.

-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: mod_dtcl-unsubscribe@tcl.apache.org
For additional commands, e-mail: mod_dtcl-help@tcl.apache.org


Mime
View raw message