Module Name:    src
Committed By:   christos
Date:           Mon Dec 17 02:06:00 UTC 2018

Modified Files:
        src/usr.bin/make: parse.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.229 -r1.230 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.229 src/usr.bin/make/parse.c:1.230
--- src/usr.bin/make/parse.c:1.229	Thu Apr  5 12:31:54 2018
+++ src/usr.bin/make/parse.c	Sun Dec 16 21:06:00 2018
@@ -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 
 
 			/*
 			 * 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 = ".";

Reply via email to