Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make PR/53796: Valery Ushakov: make prints wrong mak...



details:   https://anonhg.NetBSD.org/src/rev/f4679d50ff7d
branches:  trunk
changeset: 995349:f4679d50ff7d
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Dec 17 02:06:00 2018 +0000

description:
PR/53796: Valery Ushakov: make prints wrong makefile path in an error message
Use ${.CURDIR} if ${.PARSEDIR} is not absolute.

diffstat:

 usr.bin/make/parse.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (41 lines):

diff -r b7ed0bd4550d -r f4679d50ff7d usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Mon Dec 17 01:16:49 2018 +0000
+++ b/usr.bin/make/parse.c      Mon Dec 17 02:06:00 2018 +0000
@@ -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 @@
 
                        /*
                         * 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 = ".";



Home | Main Index | Thread Index | Old Index