rc

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

commit 600c45ab9ac6bf6a0257997d4c21d49c868ec0bb
parent 3b225b2f889a79e3b3dfef6a962e5655c91c1a96
Author: tgoodwin <tgoodwin>
Date:   Thu, 29 Oct 1998 14:13:51 +0000

pr_error now takes a line number offset

Diffstat:
Mexcept.c | 2+-
Mrc.h | 6+++---
Mutils.c | 4++--
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/except.c b/except.c @@ -120,7 +120,7 @@ extern void pop_cmdarg(bool remove) { /* exception handlers */ extern void rc_error(char *s) { - pr_error(s); + pr_error(s, -1); set(FALSE); redirq = NULL; cond = FALSE; /* no longer inside conditional */ diff --git a/rc.h b/rc.h @@ -304,7 +304,7 @@ extern void restoreblock(Block *); /* open.c */ extern int rc_open(const char *, redirtype); -extern void makeblocking(int); +extern bool makeblocking(int); /* print.c */ /* @@ -331,7 +331,7 @@ extern char *nprint(const char *fmt,...); *(f)->buf++ = (c);\ } -/* y.tab.c (parse.y) */ +/* parse.c (parse.y) */ extern Node *parsetree; extern int yyparse(void); extern void initparse(void); @@ -420,7 +420,7 @@ extern bool isabsolute(char *); extern int n2u(char *, unsigned int); extern int mvfd(int, int); extern int starstrcmp(const void *, const void *); -extern void pr_error(char *); +extern void pr_error(char *, int); extern void panic(char *); extern void uerror(char *); diff --git a/utils.c b/utils.c @@ -7,12 +7,12 @@ /* print error with line number on noninteractive shells (i.e., scripts) */ -extern void pr_error(char *s) { +extern void pr_error(char *s, int offset) { if (s != NULL) { if (interactive) fprint(2, "%s\n", s); else - fprint(2, "line %d: %s\n", lineno - 1, s); + fprint(2, "line %d: %s\n", lineno + offset, s); } }