Subject: bin/255: Escaping hash-marks in make(1) does not work
To: None <gnats-admin>
From: Thorsten Lockert <tholo@SigmaSoft.COM>
List: netbsd-bugs
Date: 05/20/1994 06:35:06
>Number:         255
>Category:       bin
>Synopsis:       make(1) ignores escapes in front of hash marks
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    gnats-admin (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 20 06:35:05 1994
>Originator:     Thorsten Lockert
>Organization:
Thorsten Lockert  | postmaster@bbb.no   |
Postbox 435       | hostmaster@bbb.no   |  Universe, n.:
N-5001 Bergen     | tholo@bbb.no        |          The problem.
Norway            | tholo@sigmasoft.com |
>Release:        
>Environment:
	
System: NetBSD gandalf.bbb.no NetBSD 0.9B NetBSD 0.9B (GANDALF) #3: Wed May 18 20:04:22 MET DST 1994 tholo@gandalf.bbb.no:/usr/src/sys/arch/i386/compile/GANDALF i386


>Description:
	Escaping hash-marks with backslash in makefiles still cause the
	hash mark to be treated as a comment-leader, and it gets stripped
	away
>How-To-Repeat:
	VAR = 'A string with a \#-mark in it'

	all:
		echo $(VAR)
>Fix:
--- src/usr.bin/make/parse.c.orig	Fri May 20 12:36:46 1994
+++ src/usr.bin/make/parse.c	Fri May 20 12:48:52 1994
@@ -2183,7 +2183,7 @@
 		break;
 	    case '#':
 		if (!ignComment) {
-		    if (compatMake || (lastc != '\\')) {
+		    if (compatMake && (lastc != '\\')) {
 			/*
 			 * If the character is a hash mark and it isn't escaped
 			 * (or we're being compatible), the thing is a comment.
>Audit-Trail:
>Unformatted:


------------------------------------------------------------------------------