diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2001-07-18 14:49:14 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2001-07-18 14:49:14 +0000 |
commit | 91a8487cb275d02a7a10a369575be6a8516d5597 (patch) | |
tree | a90c52535132a8818b254794162d407cac3b8bed /usr.bin/make/error.c | |
parent | ed6e49ee920653835b3ee83f2baaae25e31921f9 (diff) |
Avoid dumping core when reporting open conditionals.
Turns out that current is NULL when Parse_Fatal is called in this case,
so just do something sensible in error reporting functions when current is
NULL...
Diffstat (limited to 'usr.bin/make/error.c')
-rw-r--r-- | usr.bin/make/error.c | 5 |
1 files changed, 3 insertions, 2 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); |