summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/main.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1998-10-18 00:51:46 +0000
committerobrien <obrien@FreeBSD.org>1998-10-18 00:51:46 +0000
commit0c8a74dcaf35c7675c0900c6929c5cff4e470000 (patch)
treee4f65cc34c5bf1b50e2bcbd287bc12cd83325b59 /usr.bin/make/main.c
parent763d39061e90c895bd6f8760fb95c1307e8379e4 (diff)
downloadFreeBSD-src-0c8a74dcaf35c7675c0900c6929c5cff4e470000.zip
FreeBSD-src-0c8a74dcaf35c7675c0900c6929c5cff4e470000.tar.gz
Only process the ``PWD'' environmental var if built with "WANT_ENV_PWD"
defined. Bash v2 sets PWD and it creates major problems for those of us with /usr/src being a symlink. See the lists for examples of the problems.
Diffstat (limited to 'usr.bin/make/main.c')
-rw-r--r--usr.bin/make/main.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 63dbe1a..2df59ec 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -47,7 +47,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#endif
static const char rcsid[] =
- "$Id: main.c,v 1.25 1998/07/26 17:06:05 imp Exp $";
+ "$Id: main.c,v 1.26 1998/09/09 14:58:30 kato Exp $";
#endif /* not lint */
/*-
@@ -434,8 +434,12 @@ main(argc, argv)
{
Lst targs; /* target nodes to create -- passed to Make_Init */
Boolean outOfDate = TRUE; /* FALSE if all targets up to date */
- struct stat sb, sa;
- char *p, *p1, *path, *pathp, *pwd;
+ struct stat sa;
+ char *p, *p1, *path, *pathp;
+#ifdef WANT_ENV_PWD
+ struct stat sb;
+ char *pwd;
+#endif
char mdpath[MAXPATHLEN + 1];
char obpath[MAXPATHLEN + 1];
char cdpath[MAXPATHLEN + 1];
@@ -470,11 +474,13 @@ main(argc, argv)
if (stat(curdir, &sa) == -1)
err(2, "%s", curdir);
+#ifdef WANT_ENV_PWD
if ((pwd = getenv("PWD")) != NULL) {
if (stat(pwd, &sb) == 0 && sa.st_ino == sb.st_ino &&
sa.st_dev == sb.st_dev)
(void) strcpy(curdir, pwd);
}
+#endif
#if defined(__i386__)
/*
@@ -558,7 +564,9 @@ main(argc, argv)
objdir = curdir;
}
+#ifdef WANT_ENV_PWD
setenv("PWD", objdir, 1);
+#endif
create = Lst_Init(FALSE);
makefiles = Lst_Init(FALSE);
OpenPOWER on IntegriCloud