Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make Don't missinterpret targets that start with .info
details: https://anonhg.NetBSD.org/src/rev/56cde7263463
branches: trunk
changeset: 755162:56cde7263463
user: sjg <sjg%NetBSD.org@localhost>
date: Mon May 24 21:04:49 2010 +0000
description:
Don't missinterpret targets that start with .info
diffstat:
usr.bin/make/parse.c | 21 ++++++++++++---------
usr.bin/make/unit-tests/error | 6 +++++-
2 files changed, 17 insertions(+), 10 deletions(-)
diffs (90 lines):
diff -r bcb303f5cf3e -r 56cde7263463 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c Mon May 24 20:31:17 2010 +0000
+++ b/usr.bin/make/parse.c Mon May 24 21:04:49 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.163 2010/04/29 23:12:21 sjg Exp $ */
+/* $NetBSD: parse.c,v 1.164 2010/05/24 21:04:49 sjg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.163 2010/04/29 23:12:21 sjg Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.164 2010/05/24 21:04:49 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.163 2010/04/29 23:12:21 sjg Exp $");
+__RCSID("$NetBSD: parse.c,v 1.164 2010/05/24 21:04:49 sjg Exp $");
#endif
#endif /* not lint */
#endif
@@ -510,11 +510,11 @@
* variables, print the message and exit(1) (for .error) or just print
* a warning if the directive is malformed.
*/
-static void
+static Boolean
ParseMessage(char *line)
{
int mtype;
-
+
switch(*line) {
case 'i':
mtype = 0;
@@ -527,11 +527,13 @@
break;
default:
Parse_Error(PARSE_WARNING, "invalid syntax: \".%s\"", line);
- return;
+ return FALSE;
}
- while (!isspace((u_char)*line))
+ while (isalpha((u_char)*line))
line++;
+ if (!isspace((u_char)*line))
+ return FALSE; /* not for us */
while (isspace((u_char)*line))
line++;
@@ -543,6 +545,7 @@
/* Terminate immediately. */
exit(1);
}
+ return TRUE;
}
/*-
@@ -2567,8 +2570,8 @@
} else if (strncmp(cp, "info", 4) == 0 ||
strncmp(cp, "error", 5) == 0 ||
strncmp(cp, "warning", 7) == 0) {
- ParseMessage(cp);
- continue;
+ if (ParseMessage(cp))
+ continue;
}
}
diff -r bcb303f5cf3e -r 56cde7263463 usr.bin/make/unit-tests/error
--- a/usr.bin/make/unit-tests/error Mon May 24 20:31:17 2010 +0000
+++ b/usr.bin/make/unit-tests/error Mon May 24 21:04:49 2010 +0000
@@ -1,6 +1,10 @@
-# $Id: error,v 1.1 2010/04/08 17:41:29 sjg Exp $
+# $Id: error,v 1.2 2010/05/24 21:04:49 sjg Exp $
.info just FYI
.warning this could be serious
.error this is fatal
+all:
+
+.info.html:
+ @echo this should be ignored
Home |
Main Index |
Thread Index |
Old Index