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:
parent
ffe28a7fd5
commit
c8bc46c4bc
|
@ -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.
|
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
|
||||||
|
@ -70,14 +70,14 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MAKE_NATIVE
|
#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
|
#else
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94";
|
static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94";
|
||||||
#else
|
#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
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
#endif
|
#endif
|
||||||
|
@ -909,10 +909,13 @@ error:
|
||||||
|
|
||||||
condExpr += 5;
|
condExpr += 5;
|
||||||
|
|
||||||
for (arglen = 0;
|
for (arglen = 0; condExpr[arglen] != '\0'; arglen += 1) {
|
||||||
condExpr[arglen] != '(' && condExpr[arglen] != '\0';
|
if (condExpr[arglen] == '(')
|
||||||
arglen += 1)
|
break;
|
||||||
continue;
|
if (!isspace((unsigned char)condExpr[arglen]))
|
||||||
|
Parse_Error(PARSE_WARNING,
|
||||||
|
"Extra characters after \"empty\"");
|
||||||
|
}
|
||||||
|
|
||||||
if (condExpr[arglen] != '\0') {
|
if (condExpr[arglen] != '\0') {
|
||||||
val = Var_Parse(&condExpr[arglen - 1], VAR_CMD,
|
val = Var_Parse(&condExpr[arglen - 1], VAR_CMD,
|
||||||
|
|
Loading…
Reference in New Issue