X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=www%2Fwtcl.c;fp=www%2Fwtcl.c;h=ea5b2ceda7353ba982b776e8cfb352746ac1e603;hb=f96d9ce1f8c00b469ce235791055124b51db2592;hp=69d0ab45b35683e1e594de56546de7fb9cf5304d;hpb=930f1b9b6effd9f1944a74487e835c721550be2f;p=egate.git diff --git a/www/wtcl.c b/www/wtcl.c index 69d0ab4..ea5b2ce 100644 --- a/www/wtcl.c +++ b/www/wtcl.c @@ -41,6 +41,9 @@ * USE OR PERFORMANCE OF THIS SOFTWARE. * * $Log: wtcl.c,v $ + * Revision 1.22 1997/12/15 15:05:03 adam + * Enhanced the code that deals with FORM variables. + * * Revision 1.21 1997/02/10 10:15:40 adam * Bug fix: egw_source didn't work properly. * @@ -206,7 +209,6 @@ static int proc_form_invoke (struct tcl_info *p, wform_data *wfdata, { const char *arg = NULL; int failFlag = 0; - int i; if (argc == 3) { @@ -231,27 +233,27 @@ static int proc_form_invoke (struct tcl_info *p, wform_data *wfdata, arg = argv[1]; if (arg) { - for (i = 0; *wfdata[i].name; i++) - if (!strcmp (arg, wfdata[i].name)) + for (; wfdata; wfdata = wfdata->next) + if (!strcmp (arg, wfdata->name)) { failFlag = 0; - if (*wfdata[i].value) - Tcl_AppendElement (p->interp, wfdata[i].value); + if (wfdata->value) + Tcl_AppendElement (p->interp, wfdata->value); } if (failFlag) { Tcl_AppendResult (p->interp, arg, " doesn't exist", NULL); return TCL_ERROR; } - return TCL_OK; } - for (i = 0; *wfdata[i].name; i++) - { - Tcl_AppendResult (p->interp, "{ ", NULL); - Tcl_AppendElement (p->interp, wfdata[i].name); - Tcl_AppendElement (p->interp, wfdata[i].value); - Tcl_AppendResult (p->interp, " }\n", NULL); - } + else + for ( ; wfdata; wfdata = wfdata->next) + { + Tcl_AppendResult (p->interp, "{ ", NULL); + Tcl_AppendElement (p->interp, wfdata->name); + Tcl_AppendElement (p->interp, wfdata->value ? wfdata->value : ""); + Tcl_AppendResult (p->interp, " }\n", NULL); + } return TCL_OK; }