diff options
author | obrien <obrien@FreeBSD.org> | 2010-01-04 00:49:04 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2010-01-04 00:49:04 +0000 |
commit | d3158f2b66a7748dd7e67c5fc04bc181f987c5ce (patch) | |
tree | 058a74cfe9a40afdb56c0da60f9eab6b9a132d0b | |
parent | 0604e3cfcc13ca6ebe620692f7499a916036e898 (diff) | |
download | FreeBSD-src-d3158f2b66a7748dd7e67c5fc04bc181f987c5ce.zip FreeBSD-src-d3158f2b66a7748dd7e67c5fc04bc181f987c5ce.tar.gz |
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
-rw-r--r-- | usr.bin/make/parse.c | 7 |
1 files 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; } |