diff options
| author | tjg <tjg> | 2001-10-04 12:32:43 +0000 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2015-05-16 21:23:19 +0100 |
| commit | 8731b3ebc39715005c402d746e282fe2edfa7118 (patch) | |
| tree | f933d980f65fdd55518caeff68fd7752553e9662 | |
| parent | 6dedd11104490fe8ac43bd35c39c0aed12047322 (diff) | |
Bug: semantic errors in `fn prompt' no longer throw rc into a tailspin.
| -rw-r--r-- | input.c | 17 | ||||
| -rw-r--r-- | rc.1 | 11 |
2 files changed, 14 insertions, 14 deletions
@@ -242,9 +242,9 @@ extern void flushu() { extern Node *doit(bool clobberexecit) { bool eof; - bool execit ; + bool execit; Jbwrap j; - Estack e1, e2; + Estack e1; Edata jerror; if (dashen) @@ -255,6 +255,7 @@ extern Node *doit(bool clobberexecit) { except(eError, jerror, &e1); for (eof = FALSE; !eof;) { Edata block; + Estack e2; block.b = newblock(); except(eArena, block, &e2); sigchk(); @@ -270,7 +271,17 @@ extern Node *doit(bool clobberexecit) { List *s; if (!dashen && fnlookup("prompt") != NULL) { static char *arglist[] = { "prompt", NULL }; - funcall(arglist); + Estack e3; + Edata pjmp; + Jbwrap pj; + + if (sigsetjmp(pj.j, 1) == 0) { + pjmp.jb = &pj; + except(eError, pjmp, &e3); + + funcall(arglist); + unexcept(); + } } if ((s = varlookup("prompt")) != NULL) { #if EDITLINE || READLINE @@ -1959,17 +1959,6 @@ code is illegal. .TP The redundant inner parentheses must be omitted. .PP -Semantic errors (e.g. "bad concatenation") in -.B fn prompt -are not handled elegantly. For example, -.Ds -.Cr "fn prompt { echo (a b)^(c d e) }" -.De -.TP -throws -.I rc -into a tailspin. -.PP Bug reports should be mailed to .Cr "<tjg@star.le.ac.uk>" . .SH INCOMPATIBILITIES |