[Please CC - I'm not subscribed to lynx-dev.]

Thinking of the busy loop patch I sent earlier: on the other hand it makes
sense to continue when the script stream runs dry - that way you can make a
script that logs you in to somewhere and then continue interactively. OTOH,
when you use -cmd_script from scripts (as I do) you really want lynx to
exits once everything is done.

The attached patch implements an "exit" statement to cmd_scripts. Once exit
is encountered, lynx is forced to exit.

BTW: what is the proper way to exit? I used LYExit, but it didn't seem to
completely cleanup terminal...

Example:

k.script
---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
# Command logfile created by Lynx 2.8.5dev.3 (06 Oct 2001)
key g
key h
key t
key t
key p
key :
key /
key /
exit
---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---

Then try

  lynx -cmd_script=k.script http://www.hut.fi

Without the exit line you can continue from where you are.


-- v --

[EMAIL PROTECTED]
--- src/LYStrings.c.ORIG3       Fri Jun 28 09:13:39 2002
+++ src/LYStrings.c     Fri Jun 28 09:18:58 2002
@@ -5685,6 +5685,8 @@
            LYTrimTrailing(buffer);
            src = LYSkipBlanks(buffer);
            tmp = LYSkipNonBlanks(src);
+            if (strncasecomp(src, "exit", 4) == 0)
+                LYexit(0);
            if (tmp - src != 3
             || strncasecomp(src, "key", 3))
                continue;

Reply via email to