diff options
author | 2009-05-10 11:52:09 +0000 | |
---|---|---|
committer | 2009-05-10 11:52:09 +0000 | |
commit | 3fa0f368b45ac62e20bbf42177066d1dd37c80f5 (patch) | |
tree | d13ae8b3820cd36163134dbbfff96207186ecc52 | |
parent | assert copyright; ok gilles@ (diff) | |
download | wireguard-openbsd-3fa0f368b45ac62e20bbf42177066d1dd37c80f5.tar.xz wireguard-openbsd-3fa0f368b45ac62e20bbf42177066d1dd37c80f5.zip |
simple check for cvs conflicts, avoids some "duh" moments (some people like
it, other don't care, it's cheap enough). Slightly tweaked patch that also
guards against empty arrays (though it's unlikely to happen, I don't feel
like proving the array is not empty).
-rw-r--r-- | usr.bin/make/parse.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index bf04d4b95d6..198badde2a3 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: parse.c,v 1.95 2007/09/23 09:47:56 espie Exp $ */ +/* $OpenBSD: parse.c,v 1.96 2009/05/10 11:52:09 espie Exp $ */ /* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */ /* @@ -640,7 +640,15 @@ parse_do_targets(Lst paths, int *op, const char *line) if (*cp == '\0') { /* Ending a dependency line without an operator is a * Bozo no-no */ - Parse_Error(PARSE_FATAL, "Need an operator"); + /* Deeper check for cvs conflicts */ + if (gtargets.n > 0 && + (strcmp(gtargets.a[0]->name, "<<<<<<<") == 0 || + strcmp(gtargets.a[0]->name, ">>>>>>>") == 0)) { + Parse_Error(PARSE_FATAL, + "Need an operator (likely from a cvs update conflict)"); + } else { + Parse_Error(PARSE_FATAL, "Need an operator"); + } return NULL; } /* |