NetBSD Problem Report #255

From gnats  Fri May 20 03:52:27 1994
Received: from gandalf.bbb.no (root@gandalf.bbb.no [192.124.156.194]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id DAA03655 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Fri, 20 May 1994 03:52:16 -0700
Message-Id: <199405201052.MAA07199@gandalf.bbb.no>
Date: Fri, 20 May 1994 12:52:25 +0200
From: Thorsten Lockert <tholo@SigmaSoft.COM>
Reply-To: tholo@SigmaSoft.COM
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: Escaping hash-marks in make(1) does not work
X-Send-Pr-Version: 3.2

>Number:         255
>Category:       bin
>Synopsis:       make(1) ignores escapes in front of hash marks
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 20 06:35:05 +0000 1994
>Closed-Date:    Sat May 21 09:36:54 +0000 1994
>Last-Modified:  
>Originator:     Thorsten Lockert
>Release:        
>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 |
>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.
>Release-Note:
>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: jtc
State-Changed-When: Sat May 21 09:36:54 1994
State-Changed-Why:
Applied enclosed patch.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.