Module Name:    src
Committed By:   sjg
Date:           Mon May 24 21:04:49 UTC 2010

Modified Files:
        src/usr.bin/make: parse.c
        src/usr.bin/make/unit-tests: error

Log Message:
Don't missinterpret targets that start with .info


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/usr.bin/make/parse.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/error

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.163 src/usr.bin/make/parse.c:1.164
--- src/usr.bin/make/parse.c:1.163	Thu Apr 29 23:12:21 2010
+++ src/usr.bin/make/parse.c	Mon May 24 21:04:49 2010
@@ -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;
 		}		    
 	    }
 

Index: src/usr.bin/make/unit-tests/error
diff -u src/usr.bin/make/unit-tests/error:1.1 src/usr.bin/make/unit-tests/error:1.2
--- src/usr.bin/make/unit-tests/error:1.1	Thu Apr  8 17:41:29 2010
+++ src/usr.bin/make/unit-tests/error	Mon May 24 21:04:49 2010
@@ -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

Reply via email to