Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make Use the current directory at start time for .PA...



details:   https://anonhg.NetBSD.org/src/rev/f7e5ed2ba425
branches:  trunk
changeset: 762435:f7e5ed2ba425
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sun Feb 20 23:12:09 2011 +0000

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

diffstat:

 usr.bin/make/main.c  |  8 ++++----
 usr.bin/make/make.h  |  3 ++-
 usr.bin/make/parse.c |  8 ++++----
 3 files changed, 10 insertions(+), 9 deletions(-)

diffs (89 lines):

diff -r 3d6ad558764a -r f7e5ed2ba425 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Sun Feb 20 22:22:02 2011 +0000
+++ b/usr.bin/make/main.c       Sun Feb 20 23:12:09 2011 +0000
@@ -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;
diff -r 3d6ad558764a -r f7e5ed2ba425 usr.bin/make/make.h
--- a/usr.bin/make/make.h       Sun Feb 20 22:22:02 2011 +0000
+++ b/usr.bin/make/make.h       Sun Feb 20 23:12:09 2011 +0000
@@ -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 */
 
diff -r 3d6ad558764a -r f7e5ed2ba425 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Sun Feb 20 22:22:02 2011 +0000
+++ b/usr.bin/make/parse.c      Sun Feb 20 23:12:09 2011 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index