Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Jan 2010 00:49:05 +0000 (UTC)
From:      "David E. O'Brien" <obrien@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r201456 - head/usr.bin/make
Message-ID:  <201001040049.o040n5XC000182@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: obrien
Date: Mon Jan  4 00:49:04 2010
New Revision: 201456
URL: http://svn.freebsd.org/changeset/base/201456

Log:
  Report lines that ought to contain a ':' operator but start with a '.'
  as "Unknown directive" sinze they are more likely to be .elseif (etc).
  (NetBSD PR 37222).
  
  Obtained from:	NetBSD

Modified:
  head/usr.bin/make/parse.c

Modified: head/usr.bin/make/parse.c
==============================================================================
--- head/usr.bin/make/parse.c	Mon Jan  4 00:32:22 2010	(r201455)
+++ head/usr.bin/make/parse.c	Mon Jan  4 00:49:04 2010	(r201456)
@@ -699,6 +699,7 @@ static void
 ParseDoDependency(char *line)
 {
 	char	*cp;	/* our current position */
+	char	*lstart = line;	/* original input line */
 	GNode	*gn;	/* a general purpose temporary node */
 	int	op;	/* the operator on the line */
 	char	savec;	/* a place to save a character */
@@ -809,7 +810,8 @@ ParseDoDependency(char *line)
 				    "contain unresolved cvs/rcs/??? merge "
 				    "conflicts");
 			} else
-				Parse_Error(PARSE_FATAL, "Need an operator");
+				Parse_Error(PARSE_FATAL, lstart[0] == '.' ?
+				    "Unknown directive" : "Need an operator");
 			return;
 		}
 		*cp = '\0';
@@ -1029,7 +1031,8 @@ ParseDoDependency(char *line)
 			op = OP_DEPENDS;
 		}
 	} else {
-		Parse_Error(PARSE_FATAL, "Missing dependency operator");
+		Parse_Error(PARSE_FATAL, lstart[0] == '.' ?
+		    "Unknown directive" : "Missing dependency operator");
 		return;
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001040049.o040n5XC000182>