Fixed some bugs with escape sequences.
[egate.git] / www / wtcl.c
index ea5b2ce..f67fb32 100644 (file)
@@ -41,6 +41,9 @@
  * USE OR PERFORMANCE OF THIS SOFTWARE.
  *
  * $Log: wtcl.c,v $
+ * Revision 1.23  1998/03/26 11:29:02  franck
+ * Fixed some bugs with escape sequences.
+ *
  * Revision 1.22  1997/12/15 15:05:03  adam
  * Enhanced the code that deals with FORM variables.
  *
@@ -324,7 +327,7 @@ static int proc_enc (ClientData clientData, Tcl_Interp *interp,
         while (*cp)
         { 
             if (*cp < ' ' || *cp >= 127 || *cp == '&' || *cp == '?'
-                || *cp == '%' || *cp == '+' || *cp == '"')
+                || *cp == '%' || *cp == '+' || *cp == '"' || *cp == '=')
             {
                 sprintf (buf1+1, "%02X", *cp & 0xff);
                 Tcl_AppendResult (interp, buf1, NULL);
@@ -619,15 +622,19 @@ static int exec_file (const char *fname, struct tcl_info *p)
         case '$':
             if (escape)
             {
-                c = getc (inf);
                 wo_putc (p->wcl, c);
+                escape = 0;
+                c = getc (inf);
             }
             else
                 c = var_ref (p, inf);
             break;
         case '{':
             if (escape)
+            {
                 wo_putc (p->wcl, c);
+                escape = 0;
+            }
             else
             {
                 int r = tcl_exec (fname, p, inf, &lineno);
@@ -642,7 +649,6 @@ static int exec_file (const char *fname, struct tcl_info *p)
                     return -2;
                 }
             }
-            escape = 0;
             c = getc (inf);
             break;
         default: