diff options
| author | christos <christos@NetBSD.org> | 2018-12-17 02:06:00 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2018-12-17 02:06:00 +0000 |
| commit | 8239e7e5eab09b788a3dd2de7389efc00a87fd36 (patch) | |
| tree | 5c26f28823eb66bf7625cbadc6d300fa9673992f /usr.bin/make | |
| parent | 3a16803afb10b4229d943f94de9d1b9c1ac28416 (diff) | |
PR/53796: Valery Ushakov: make prints wrong makefile path in an error message
Use ${.CURDIR} if ${.PARSEDIR} is not absolute.
Diffstat (limited to 'usr.bin/make')
| -rw-r--r-- | usr.bin/make/parse.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index fa6e87a7ffd..1a936011030 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.229 2018/04/05 16:31:54 christos Exp $ */ +/* $NetBSD: parse.c,v 1.230 2018/12/17 02:06:00 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.229 2018/04/05 16:31:54 christos Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.230 2018/12/17 02:06:00 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.229 2018/04/05 16:31:54 christos Exp $"); +__RCSID("$NetBSD: parse.c,v 1.230 2018/12/17 02:06:00 christos Exp $"); #endif #endif /* not lint */ #endif @@ -681,11 +681,11 @@ ParseVErrorInternal(FILE *f, const char *cfname, size_t clineno, int type, /* * Nothing is more annoying than not knowing - * which Makefile is the culprit. + * which Makefile is the culprit; we try ${.PARSEDIR} + * first and if that's not absolute, we try ${.CURDIR} */ dir = Var_Value(".PARSEDIR", VAR_GLOBAL, &cp); - if (dir == NULL || *dir == '\0' || - (*dir == '.' && dir[1] == '\0')) + if (dir == NULL || *dir == '\0' || *dir != '/') dir = Var_Value(".CURDIR", VAR_GLOBAL, &cp); if (dir == NULL) dir = "."; |
