diff options
| author | christos <christos@NetBSD.org> | 2001-02-23 21:11:38 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2001-02-23 21:11:38 +0000 |
| commit | 3e343f9152b097779d5fdc8db1d51208f17018b3 (patch) | |
| tree | 1a06d6ae5c5b916b00d1bec2d7e8178b21267e46 /usr.bin/make/parse.c | |
| parent | 5460e0c1978013ce6893799070e7d61bd0839593 (diff) | |
PR/12251: Thomas Klausner: Make core dumps on unclosed conditional.
Well, it should say 'make core-dumps on any error on the primary makefile'.
This was a result of the new changes to print the path to the parsed
Makefile... Made the code a lot more conservative, plus prepended <progname>:
to each message.
Diffstat (limited to 'usr.bin/make/parse.c')
| -rw-r--r-- | usr.bin/make/parse.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index a655360d9be..699b7b3df8b 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.62 2001/01/14 20:54:16 mycroft Exp $ */ +/* $NetBSD: parse.c,v 1.63 2001/02/23 21:11:38 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -39,14 +39,14 @@ */ #ifdef MAKE_BOOTSTRAP -static char rcsid[] = "$NetBSD: parse.c,v 1.62 2001/01/14 20:54:16 mycroft Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.63 2001/02/23 21:11:38 christos Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.62 2001/01/14 20:54:16 mycroft Exp $"); +__RCSID("$NetBSD: parse.c,v 1.63 2001/02/23 21:11:38 christos Exp $"); #endif #endif /* not lint */ #endif @@ -342,6 +342,8 @@ ParseVErrorInternal(va_alist) { static Boolean fatal_warning_error_printed = FALSE; + (void)fprintf(stderr, "%s: \"", progname); + if (*cfname != '/') { char *cp, *dir; @@ -350,13 +352,17 @@ ParseVErrorInternal(va_alist) * is the culprit. */ dir = Var_Value(".PARSEDIR", VAR_GLOBAL, &cp); - if (*dir == '\0' || + if (dir == NULL || *dir == '\0' || (*dir == '.' && dir[1] == '\0')) dir = Var_Value(".CURDIR", VAR_GLOBAL, &cp); + if (dir == NULL) + dir = "."; - (void)fprintf(stderr, "\"%s/%s\", line %d: ", dir, cfname, (int) clineno); + (void)fprintf(stderr, "%s/%s", dir, cfname); } else - (void)fprintf(stderr, "\"%s\", line %d: ", cfname, (int) clineno); + (void)fprintf(stderr, "%s", cfname); + + (void)fprintf(stderr, "\" line %d: ", (int)clineno); if (type == PARSE_WARNING) (void)fprintf(stderr, "warning: "); (void)vfprintf(stderr, fmt, ap); @@ -2707,7 +2713,9 @@ Parse_File(name, stream) Cond_End(); if (fatals) { - fprintf (stderr, "Fatal errors encountered -- cannot continue\n"); + (void)fprintf(stderr, + "%s: Fatal errors encountered -- cannot continue\n", + progname); exit (1); } } |
