From: espie Date: Wed, 21 Jun 2017 00:11:36 +0000 (+0000) Subject: error out if an exists condition tests an empty path, because that makes X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=663679869f8db359e6fa8611149e5cecfd86507f;p=openbsd error out if an exists condition tests an empty path, because that makes zero sense. this would have caught DEPENDSFILE in gnu/cc/cc_tools okay guenther@, also tested by krw@ --- diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c index 588784284b1..41ff09a9857 100644 --- a/usr.bin/make/cond.c +++ b/usr.bin/make/cond.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cond.c,v 1.51 2016/10/21 16:12:38 espie Exp $ */ +/* $OpenBSD: cond.c,v 1.52 2017/06/21 00:11:36 espie Exp $ */ /* $NetBSD: cond.c,v 1.7 1996/11/06 17:59:02 christos Exp $ */ /* @@ -292,6 +292,9 @@ CondDoExists(struct Name *arg) bool result; char *path; + if (arg->s == arg->e) + Parse_Error(PARSE_FATAL, "Empty file name in .if exists()"); + path = Dir_FindFilei(arg->s, arg->e, defaultPath); if (path != NULL) { result = true;