Module Name:    src
Committed By:   christos
Date:           Thu May 24 00:27:25 UTC 2018

Modified Files:
        src/usr.bin/make: var.c

Log Message:
Since ${MAKE} converts $$ -> $ during parsing we need to put it back to
preserve the original variable value with :Q.
XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.218 -r1.219 src/usr.bin/make/var.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.218 src/usr.bin/make/var.c:1.219
--- src/usr.bin/make/var.c:1.218	Sat Feb 17 19:52:42 2018
+++ src/usr.bin/make/var.c	Wed May 23 20:27:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.218 2018/02/18 00:52:42 sjg Exp $	*/
+/*	$NetBSD: var.c,v 1.219 2018/05/24 00:27:24 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.218 2018/02/18 00:52:42 sjg Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.219 2018/05/24 00:27:24 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.218 2018/02/18 00:52:42 sjg Exp $");
+__RCSID("$NetBSD: var.c,v 1.219 2018/05/24 00:27:24 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2347,6 +2347,8 @@ VarQuote(char *str)
 	if (isspace((unsigned char)*str) || ismeta((unsigned char)*str))
 	    Buf_AddByte(&buf, '\\');
 	Buf_AddByte(&buf, *str);
+	if (*str == '$')
+	    Buf_AddBytes(&buf, 2, "\\$");
     }
 
     str = Buf_Destroy(&buf, FALSE);

Reply via email to