Module Name:    src
Committed By:   joerg
Date:           Sun Feb 20 23:12:09 UTC 2011

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

Log Message:
Use the current directory at start time for .PARSEDIR, if the filename
contains no /.


To generate a diff of this commit:
cvs rdiff -u -r1.195 -r1.196 src/usr.bin/make/main.c
cvs rdiff -u -r1.84 -r1.85 src/usr.bin/make/make.h
cvs rdiff -u -r1.175 -r1.176 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/main.c
diff -u src/usr.bin/make/main.c:1.195 src/usr.bin/make/main.c:1.196
--- src/usr.bin/make/main.c:1.195	Sun Feb 13 21:24:43 2011
+++ src/usr.bin/make/main.c	Sun Feb 20 23:12:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.195 2011/02/13 21:24:43 sjg Exp $	*/
+/*	$NetBSD: main.c,v 1.196 2011/02/20 23:12:09 joerg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.195 2011/02/13 21:24:43 sjg Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.196 2011/02/20 23:12:09 joerg Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
@@ -81,7 +81,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.195 2011/02/13 21:24:43 sjg Exp $");
+__RCSID("$NetBSD: main.c,v 1.196 2011/02/20 23:12:09 joerg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -181,8 +181,8 @@
 static void		usage(void);
 
 static Boolean		ignorePWD;	/* if we use -C, PWD is meaningless */
-static char curdir[MAXPATHLEN + 1];	/* startup directory */
 static char objdir[MAXPATHLEN + 1];	/* where we chdir'ed to */
+char curdir[MAXPATHLEN + 1];		/* Startup directory */
 char *progname;				/* the program name */
 char *makeDependfile;
 pid_t myPid;

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.84 src/usr.bin/make/make.h:1.85
--- src/usr.bin/make/make.h:1.84	Thu Nov 25 21:31:09 2010
+++ src/usr.bin/make/make.h	Sun Feb 20 23:12:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.84 2010/11/25 21:31:09 christos Exp $	*/
+/*	$NetBSD: make.h,v 1.85 2011/02/20 23:12:09 joerg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -394,6 +394,7 @@
 extern Lst	sysIncPath;	/* The system include path. */
 extern Lst	defIncPath;	/* The default include path. */
 
+extern char	curdir[];	/* Startup directory */
 extern char	*progname;	/* The program name */
 extern char	*makeDependfile; /* .depend */
 

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.175 src/usr.bin/make/parse.c:1.176
--- src/usr.bin/make/parse.c:1.175	Sun Feb 20 20:17:35 2011
+++ src/usr.bin/make/parse.c	Sun Feb 20 23:12:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.175 2011/02/20 20:17:35 dholland Exp $	*/
+/*	$NetBSD: parse.c,v 1.176 2011/02/20 23:12:09 joerg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.175 2011/02/20 20:17:35 dholland Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.176 2011/02/20 23:12:09 joerg 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.175 2011/02/20 20:17:35 dholland Exp $");
+__RCSID("$NetBSD: parse.c,v 1.176 2011/02/20 23:12:09 joerg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2208,7 +2208,7 @@
 
     slash = strrchr(filename, '/');
     if (slash == NULL) {
-	Var_Set(".PARSEDIR", ".", VAR_GLOBAL, 0);
+	Var_Set(".PARSEDIR", curdir, VAR_GLOBAL, 0);
 	Var_Set(".PARSEFILE", filename, VAR_GLOBAL, 0);
     } else {
 	len = slash - filename;

Reply via email to