use the logical path for -C if correct.
This commit is contained in:
parent
5acf460d25
commit
fa1ea25f42
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: main.c,v 1.255 2017/01/31 06:54:23 sjg Exp $ */
|
/* $NetBSD: main.c,v 1.256 2017/02/07 21:16:31 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1988, 1989, 1990, 1993
|
* Copyright (c) 1988, 1989, 1990, 1993
|
||||||
@ -69,7 +69,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MAKE_NATIVE
|
#ifndef MAKE_NATIVE
|
||||||
static char rcsid[] = "$NetBSD: main.c,v 1.255 2017/01/31 06:54:23 sjg Exp $";
|
static char rcsid[] = "$NetBSD: main.c,v 1.256 2017/02/07 21:16:31 christos Exp $";
|
||||||
#else
|
#else
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\
|
|||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
|
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: main.c,v 1.255 2017/01/31 06:54:23 sjg Exp $");
|
__RCSID("$NetBSD: main.c,v 1.256 2017/02/07 21:16:31 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
#endif
|
#endif
|
||||||
@ -376,6 +376,7 @@ MainParseArgs(int argc, char **argv)
|
|||||||
int arginc;
|
int arginc;
|
||||||
char *argvalue;
|
char *argvalue;
|
||||||
const char *getopt_def;
|
const char *getopt_def;
|
||||||
|
struct stat sa, sb;
|
||||||
char *optscan;
|
char *optscan;
|
||||||
Boolean inOption, dashDash = FALSE;
|
Boolean inOption, dashDash = FALSE;
|
||||||
char found_path[MAXPATHLEN + 1]; /* for searching for sys.mk */
|
char found_path[MAXPATHLEN + 1]; /* for searching for sys.mk */
|
||||||
@ -444,6 +445,11 @@ rearg:
|
|||||||
(void)fprintf(stderr, "%s: %s.\n", progname, strerror(errno));
|
(void)fprintf(stderr, "%s: %s.\n", progname, strerror(errno));
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
|
if (stat(argvalue, &sa) != -1 &&
|
||||||
|
stat(curdir, &sb) != -1 &&
|
||||||
|
sa.st_ino == sb.st_ino &&
|
||||||
|
sa.st_dev == sb.st_dev)
|
||||||
|
strlcpy(curdir, argvalue, MAXPATHLEN);
|
||||||
ignorePWD = TRUE;
|
ignorePWD = TRUE;
|
||||||
break;
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
|
Loading…
Reference in New Issue
Block a user