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 logical path for -C if correct.



details:   https://anonhg.NetBSD.org/src/rev/b802f616042a
branches:  trunk
changeset: 821473:b802f616042a
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Feb 07 21:16:31 2017 +0000

description:
use the logical path for -C if correct.

diffstat:

 usr.bin/make/main.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (47 lines):

diff -r cb65786ef6a5 -r b802f616042a usr.bin/make/main.c
--- a/usr.bin/make/main.c       Tue Feb 07 19:29:39 2017 +0000
+++ b/usr.bin/make/main.c       Tue Feb 07 21:16:31 2017 +0000
@@ -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
@@ -69,7 +69,7 @@
  */
 
 #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
 #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.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 /* not lint */
 #endif
@@ -376,6 +376,7 @@
        int arginc;
        char *argvalue;
        const char *getopt_def;
+       struct stat sa, sb;
        char *optscan;
        Boolean inOption, dashDash = FALSE;
        char found_path[MAXPATHLEN + 1];        /* for searching for sys.mk */
@@ -444,6 +445,11 @@
                                (void)fprintf(stderr, "%s: %s.\n", progname, strerror(errno));
                                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;
                        break;
                case 'D':



Home | Main Index | Thread Index | Old Index