Plus (+) characters automatically converted to space in forms.
[egate.git] / www / wsh.c
index a67590a..c6093f4 100644 (file)
--- a/www/wsh.c
+++ b/www/wsh.c
  * USE OR PERFORMANCE OF THIS SOFTWARE.
  *
  * $Log: wsh.c,v $
- * Revision 1.4  1995/10/27 15:12:12  adam
+ * Revision 1.7  1995/11/06 17:44:23  adam
+ * State reestablised when shell restarts. History of previous
+ * result sets.
+ *
+ * Revision 1.6  1995/11/06  10:51:19  adam
+ * End of response marker in response from wsh/wproto to wcgi.
+ * Shells are respawned when necessary.
+ *
+ * Revision 1.5  1995/11/01  16:15:48  adam
+ * Better presentation of records. Query/set number persistent.
+ *
+ * Revision 1.4  1995/10/27  15:12:12  adam
  * IrTcl incorporated in the gateway.
  * Better separation of script types.
  * Z39.50 gateway scripts entered.
@@ -105,8 +116,11 @@ int main (int argc, char **argv)
                *argv);
         exit (1);
     }
+    w_interp_load_state (w_interp, NULL);
     while (wproto_process(wcl, timeout) > 0)
     {
+        char *p;
+
        wo_clear (wcl, "text/html");
        strcpy (parms_buf, wcl->wf_parms);
        script = parms = parms_buf;
@@ -116,7 +130,7 @@ int main (int argc, char **argv)
            *parms++ = '\0';
         if (*script)
         {
-            char *p = script + strlen(script) - 1;
+            p = script + strlen(script) - 1;
             while (*p && p != script)
                 switch (*p)
                 {
@@ -140,6 +154,9 @@ int main (int argc, char **argv)
                     --p;
                 }
         }
+        for (p = parms; *p; p++)
+            if (*p == '+')
+                *p = ' ';
        gw_log (GW_LOG_DEBUG, mod, "script: %s", script);
        gw_log (GW_LOG_DEBUG, mod, "parms: %s", parms);
         if (w_interp_exec (w_interp, script, parms))
@@ -150,6 +167,7 @@ int main (int argc, char **argv)
         }
        wo_finish(wcl);
     }
+    w_interp_save_state (w_interp, NULL);
     wproto_terminate(wcl);
     return 0;
 }