Module Name: src
Committed By: sjg
Date: Sat Mar 24 20:28:42 UTC 2012
Modified Files:
src/usr.bin/make: parse.c
Log Message:
Avoid the need to escape the # in :[#] when parsing conditionals.
To generate a diff of this commit:
cvs rdiff -u -r1.180 -r1.181 src/usr.bin/make/parse.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/parse.c
diff -u src/usr.bin/make/parse.c:1.180 src/usr.bin/make/parse.c:1.181
--- src/usr.bin/make/parse.c:1.180 Sun Nov 6 19:46:56 2011
+++ src/usr.bin/make/parse.c Sat Mar 24 20:28:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.180 2011/11/06 19:46:56 christos Exp $ */
+/* $NetBSD: parse.c,v 1.181 2012/03/24 20:28:41 sjg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.180 2011/11/06 19:46:56 christos Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.181 2012/03/24 20:28:41 sjg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: parse.c,v 1.180 2011/11/06 19:46:56 christos Exp $");
+__RCSID("$NetBSD: parse.c,v 1.181 2012/03/24 20:28:41 sjg Exp $");
#endif
#endif /* not lint */
#endif
@@ -2524,7 +2524,9 @@ ParseGetLine(int flags, int *length)
}
if (ch == '#' && comment == NULL) {
/* Remember first '#' for comment stripping */
- comment = line_end;
+ /* Unless previous char was '[', as in modifier :[#] */
+ if (!(ptr > line && ptr[-1] == '['))
+ comment = line_end;
}
ptr++;
if (ch == '\n')