rc

[fork] interactive rc shell
Log | Files | Refs | README | LICENSE

commit a25e66a479d5fea0eac3d74fbe3a082352799358
parent 0d3f5de9280d8854871efd8a99d1590ea768e350
Author: tjg <tjg>
Date:   Fri, 12 Oct 2001 09:30:14 +0000

  Bug: semantic errors in `fn prompt' no longer throw rc into a tailspin.

Diffstat:
Minput.c | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/input.c b/input.c @@ -243,7 +243,6 @@ extern void flushu() { extern Node *doit(bool clobberexecit) { bool eof; bool execit; - bool infnprompt; Jbwrap j; Estack e1; Edata jerror; @@ -251,7 +250,6 @@ extern Node *doit(bool clobberexecit) { if (dashen) clobberexecit = FALSE; execit = clobberexecit; - infnprompt = FALSE; sigsetjmp(j.j, 1); jerror.jb = &j; except(eError, jerror, &e1); @@ -272,13 +270,14 @@ extern Node *doit(bool clobberexecit) { if (interactive) { List *s; if (!dashen && fnlookup("prompt") != NULL) { + static bool died = FALSE; static char *arglist[] = { "prompt", NULL }; - if (!infnprompt) { - infnprompt = TRUE; + if (!died) { + died = TRUE; funcall(arglist); } - infnprompt = FALSE; + died = FALSE; } if ((s = varlookup("prompt")) != NULL) { #if EDITLINE || READLINE