Use the current directory at start time for .PARSEDIR, if the filename
contains no /.
This commit is contained in:
parent
134bad206f
commit
bfc4d64e8a
|
@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\
|
|||
#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 int ReadMakefile(const void *, const void *);
|
|||
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;
|
||||
|
|
|
@ -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 Boolean oldVars; /* Do old-style variable substitution */
|
|||
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 */
|
||||
|
||||
|
|
|
@ -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 @@ ParseSetParseFile(const char *filename)
|
|||
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue