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/lowparse.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/lowparse.c')
-rw-r--r-- | usr.bin/make/lowparse.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 |