diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2012-08-25 08:12:57 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2012-08-25 08:12:57 +0000 |
commit | bdd9ef1d17a1992473f740dec62beee2677fc790 (patch) | |
tree | 55d88cf2396b994b7500a9075330f44bccd7bcbd /usr.bin/make/varname.c | |
parent | b2facb17a734f040dbe25ca0d9d26768b7d4b7b5 (diff) |
- make wrong variable specs (unterminated) parse errors.
- add info to be able to pinpoint parse errors at runtime.
- let job runners abort when a parse error happens while expanding a variable
during execution
- fix an infinite loop when compiling without FEATURE_RECVARS.
okay millert@, krw@
the very few errors found out by this (less than 10 over src/X/ports)
fixed trivially beforehand, as requested by deraadt@
Diffstat (limited to 'usr.bin/make/varname.c')
-rw-r--r-- | usr.bin/make/varname.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/make/varname.c b/usr.bin/make/varname.c index cbacb14c2ba..b54802f480d 100644 --- a/usr.bin/make/varname.c +++ b/usr.bin/make/varname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: varname.c,v 1.5 2010/07/19 19:46:44 espie Exp $ */ +/* $OpenBSD: varname.c,v 1.6 2012/08/25 08:12:56 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. * @@ -32,7 +32,8 @@ #include "varname.h" const char * -VarName_Get(const char *start, struct Name *name, SymTable *ctxt, bool err, const char *(*cont)(const char *)) +VarName_Get(const char *start, struct Name *name, SymTable *ctxt, bool err, + const char *(*cont)(const char *)) { const char *p; size_t len; @@ -41,7 +42,7 @@ VarName_Get(const char *start, struct Name *name, SymTable *ctxt, bool err, cons /* If we don't want recursive variables, we skip over '$' */ if (!FEATURES(FEATURE_RECVARS)) { while (*p == '$') - p = cont(p); + p = cont(p+1); } if (*p != '$') { name->s = start; |