From d3158f2b66a7748dd7e67c5fc04bc181f987c5ce Mon Sep 17 00:00:00 2001 From: obrien Date: Mon, 4 Jan 2010 00:49:04 +0000 Subject: 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 --- usr.bin/make/parse.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 3d9a92a..134d905 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -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; } -- cgit v1.1