diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2003-10-07 18:33:09 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2003-10-07 18:33:09 +0000 |
commit | 29abf1981089118cea78a23844ba31e692f331d6 (patch) | |
tree | 2e59a01484deff4637c9cc274ed15646d7850f36 /usr.bin/make | |
parent | efa5db6a09beb98d6ce40775b2717cc31abae3be (diff) |
- check if result is valid before using it.
- correctly set *freePtr, not freePtr.
input and ok espie@.
Diffstat (limited to 'usr.bin/make')
-rw-r--r-- | usr.bin/make/var.c | 5 | ||||
-rw-r--r-- | usr.bin/make/varmodifiers.c | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index a930a965225..e2dbb058871 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: var.c,v 1.57 2003/06/03 02:56:12 millert Exp $ */ +/* $OpenBSD: var.c,v 1.58 2003/10/07 18:33:08 fgsch Exp $ */ /* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */ /* @@ -841,7 +841,8 @@ Var_ParseSkip(str, ctxt, result) if (*tstr == ':' && endc != '\0') if (VarModifiers_Apply(NULL, NULL, ctxt, true, NULL, tstr, endc, &length) == var_Error) - *result = false; + if (result != NULL) + *result = false; return length; } diff --git a/usr.bin/make/varmodifiers.c b/usr.bin/make/varmodifiers.c index 7ea33452236..81b651c422b 100644 --- a/usr.bin/make/varmodifiers.c +++ b/usr.bin/make/varmodifiers.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: varmodifiers.c,v 1.11 2003/06/03 02:56:12 millert Exp $ */ +/* $OpenBSD: varmodifiers.c,v 1.12 2003/10/07 18:33:08 fgsch Exp $ */ /* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */ /* @@ -1592,7 +1592,7 @@ VarModifiers_Apply(str, name, ctxt, err, freePtr, start, endc, lengthPtr) if (str != NULL && *freePtr) free(str); str = var_Error; - freePtr = false; + *freePtr = false; break; } if (DEBUG(VAR)) |