summaryrefslogtreecommitdiff
path: root/usr.bin/awk/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/awk/lib.c')
-rw-r--r--usr.bin/awk/lib.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/awk/lib.c b/usr.bin/awk/lib.c
index 38660b4fac3..9706244dbc8 100644
--- a/usr.bin/awk/lib.c
+++ b/usr.bin/awk/lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib.c,v 1.5 1999/04/18 17:06:30 millert Exp $ */
+/* $OpenBSD: lib.c,v 1.6 1999/04/20 17:31:29 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -487,6 +487,8 @@ void yyerror(char *s)
fprintf(stderr, " at source line %d", lineno);
if (curfname != NULL)
fprintf(stderr, " in function %s", curfname);
+ if (compile_time == 1 && cursource() != NULL)
+ fprintf(stderr, " source file %s", cursource());
fprintf(stderr, "\n");
errorflag = 2;
eprint();
@@ -541,9 +543,12 @@ void error(int f, char *s)
fprintf(stderr, "\n");
}
if (compile_time != 2 && curnode)
- fprintf(stderr, " source line number %d\n", curnode->lineno);
+ fprintf(stderr, " source line number %d", curnode->lineno);
else if (compile_time != 2 && lineno)
- fprintf(stderr, " source line number %d\n", lineno);
+ fprintf(stderr, " source line number %d", lineno);
+ if (compile_time == 1 && cursource() != NULL)
+ fprintf(stderr, " source file %s", cursource());
+ fprintf(stderr, "\n");
eprint();
if (f) {
if (dbg > 1) /* core dump if serious debugging on */
@@ -602,7 +607,6 @@ void bclass(int c)
double errcheck(double x, char *s)
{
- extern int errno;
if (errno == EDOM) {
errno = 0;