Warn for constructs like

.if empty xxx(foo)
which are interpreted as
.if empty(foo)
or
.if empty (foo)

This is based on rillig's commit to pkgsrc/devel/bmake, but doesn't warn
for the third case. Discussed with sjg.
This commit is contained in:
joerg 2008-02-06 18:26:37 +00:00
parent ffe28a7fd5
commit c8bc46c4bc
1 changed files with 10 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cond.c,v 1.37 2007/02/04 19:23:49 dsl Exp $ */
/* $NetBSD: cond.c,v 1.38 2008/02/06 18:26:37 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
static char rcsid[] = "$NetBSD: cond.c,v 1.37 2007/02/04 19:23:49 dsl Exp $";
static char rcsid[] = "$NetBSD: cond.c,v 1.38 2008/02/06 18:26:37 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94";
#else
__RCSID("$NetBSD: cond.c,v 1.37 2007/02/04 19:23:49 dsl Exp $");
__RCSID("$NetBSD: cond.c,v 1.38 2008/02/06 18:26:37 joerg Exp $");
#endif
#endif /* not lint */
#endif
@ -909,10 +909,13 @@ error:
condExpr += 5;
for (arglen = 0;
condExpr[arglen] != '(' && condExpr[arglen] != '\0';
arglen += 1)
continue;
for (arglen = 0; condExpr[arglen] != '\0'; arglen += 1) {
if (condExpr[arglen] == '(')
break;
if (!isspace((unsigned char)condExpr[arglen]))
Parse_Error(PARSE_WARNING,
"Extra characters after \"empty\"");
}
if (condExpr[arglen] != '\0') {
val = Var_Parse(&condExpr[arglen - 1], VAR_CMD,