Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make An X!= command, can cause Shell_Init() to be ca...



details:   https://anonhg.NetBSD.org/src/rev/6b5077f24eba
branches:  trunk
changeset: 779979:6b5077f24eba
user:      sjg <sjg%NetBSD.org@localhost>
date:      Tue Jul 03 21:03:40 2012 +0000

description:
An X!= command, can cause Shell_Init() to be called before Job_ParseShell().
Job_ParseShell() should call Shell_Init() again if needed
to ensure shellPath is correct.

diffstat:

 usr.bin/make/job.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (48 lines):

diff -r 970c3ca077f4 -r 6b5077f24eba usr.bin/make/job.c
--- a/usr.bin/make/job.c        Tue Jul 03 19:09:44 2012 +0000
+++ b/usr.bin/make/job.c        Tue Jul 03 21:03:40 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.162 2012/06/12 19:21:50 joerg Exp $  */
+/*     $NetBSD: job.c,v 1.163 2012/07/03 21:03:40 sjg Exp $    */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.162 2012/06/12 19:21:50 joerg Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.163 2012/07/03 21:03:40 sjg Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)job.c      8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: job.c,v 1.162 2012/06/12 19:21:50 joerg Exp $");
+__RCSID("$NetBSD: job.c,v 1.163 2012/07/03 21:03:40 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2423,7 +2423,7 @@
         * If no path was given, the user wants one of the pre-defined shells,
         * yes? So we find the one s/he wants with the help of JobMatchShell
         * and set things up the right way. shellPath will be set up by
-        * Job_Init.
+        * Shell_Init.
         */
        if (newShell.name == NULL) {
            Parse_Error(PARSE_FATAL, "Neither path nor name specified");
@@ -2438,6 +2438,12 @@
            }
            commandShell = sh;
            shellName = newShell.name;
+           if (shellPath) {
+               /* Shell_Init has already been called!  Do it again. */
+               free(UNCONST(shellPath));
+               shellPath = NULL;
+               Shell_Init();
+           }
        }
     } else {
        /*



Home | Main Index | Thread Index | Old Index