You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_dtcl@tcl.apache.org by yahalom emet <ya...@zvia.org.il> on 2002/05/02 11:50:05 UTC

bug report

Hello

continuing the bug of "var get" that was fixed in version 0.11.6 also "var exist" show the same behaviour. I get 1 for "var exist" when I check existance of a varibale that starts with the letter of another variable.

example:

<?
set details [var get details]
set detailsRemark [var get detailsRemark]
hputs "details-$details \n"
hputs "detailsRemark-$detailsRemark"
hputs "does de exists- [var exists de]
?>
<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>

Thanks

Yahalom Emet
Software Developer
Xor Technologies Ltd.

Tel: +972 (0)4-6619164
E-mail: yahalom@zvia.org.il
Web: http://www.xortechnologies.com



Re: bug report

Posted by "David N. Welton" <da...@dedasys.com>.
"yahalom emet" <ya...@zvia.org.il> writes:

> continuing the bug of "var get" that was fixed in version 0.11.6
> also "var exist" show the same behaviour. I get 1 for "var exist"
> when I check existance of a varibale that starts with the letter of
> another variable.

Patch:

@@ -571,7 +571,9 @@
         /* This isn't real efficient - move to hash table later 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)))
            {
                result = Tcl_NewIntObj(1);
                Tcl_IncrRefCount(result);
@@ -595,7 +597,9 @@
         /* This isn't real efficient - move to hash table later 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)))
            {
                if (result == NULL)
                {

Upload coming soon.

Thankyou for taking the time to point this out!

-- 
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