diff options
-rw-r--r-- | usr.bin/make/error.c | 5 | ||||
-rw-r--r-- | usr.bin/make/lowparse.c | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/make/error.c b/usr.bin/make/error.c index ddcc8c072a0..f2624f91dcd 100644 --- a/usr.bin/make/error.c +++ b/usr.bin/make/error.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: error.c,v 1.7 2001/05/29 12:17:05 espie Exp $ */ +/* $OpenBSD: error.c,v 1.8 2001/07/18 14:49:13 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -194,7 +194,8 @@ ParseVErrorInternal(va_alist) va_dcl #endif { - (void)fprintf(stderr, "\"%s\", line %lu: ", cfname, clineno); + if (cfname) + (void)fprintf(stderr, "\"%s\", line %lu: ", cfname, clineno); if (type == PARSE_WARNING) (void)fprintf(stderr, "warning: "); (void)vfprintf(stderr, fmt, ap); diff --git a/usr.bin/make/lowparse.c b/usr.bin/make/lowparse.c index 71922561d75..b82b66c735c 100644 --- a/usr.bin/make/lowparse.c +++ b/usr.bin/make/lowparse.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: lowparse.c,v 1.12 2001/07/11 12:59:43 espie Exp $ */ +/* $OpenBSD: lowparse.c,v 1.13 2001/07/18 14:49:13 espie Exp $ */ /* low-level parsing functions. */ @@ -430,13 +430,13 @@ Parse_ReadNormalLine(linebuf) unsigned long Parse_Getlineno() { - return current->lineno; + return current ? current->lineno : 0; } const char * Parse_Getfilename() { - return current->fname; + return current ? current->fname : NULL; } #ifdef CLEANUP |