diff options
author | harti <harti@FreeBSD.org> | 2005-03-22 08:06:34 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2005-03-22 08:06:34 +0000 |
commit | 9c7887893bf5a1122ab81fa7a1a93f6f8934b3e3 (patch) | |
tree | b4085e1363c3c9cdc799cbbed27a901c990bd888 /usr.bin/make/var.c | |
parent | 6218a3c3c190c9b7c1cc74eb3e3bc26cd51cbaba (diff) | |
download | FreeBSD-src-9c7887893bf5a1122ab81fa7a1a93f6f8934b3e3.zip FreeBSD-src-9c7887893bf5a1122ab81fa7a1a93f6f8934b3e3.tar.gz |
Use the struct VarPattern's lhs field instead of using an extra variable
to store the left expression of a C modificator.
Patch: 7.157
Submitted by: Max Okumoto <okumoto@ucsd.edu>
Diffstat (limited to 'usr.bin/make/var.c')
-rw-r--r-- | usr.bin/make/var.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index d68a23b..c1ba395 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -984,7 +984,6 @@ modifier_C(VarParser *vp, char value[], Var *v) { VarPattern patt; char delim; - char *re; int error; char *newValue; @@ -996,8 +995,8 @@ modifier_C(VarParser *vp, char value[], Var *v) vp->ptr++; /* consume 1st delim */ - re = VarGetPattern(vp, delim, NULL, NULL, NULL); - if (re == NULL) { + patt.lhs = VarGetPattern(vp, delim, NULL, NULL, NULL); + if (patt.lhs == NULL) { Fatal("Unclosed substitution for %s (%c missing)", v->name, delim); } @@ -1025,11 +1024,11 @@ modifier_C(VarParser *vp, char value[], Var *v) break; } - error = regcomp(&patt.re, re, REG_EXTENDED); + error = regcomp(&patt.re, patt.lhs, REG_EXTENDED); if (error) { VarREError(error, &patt.re, "RE substitution error"); free(patt.rhs); - free(re); + free(patt.lhs); return (var_Error); } @@ -1045,7 +1044,7 @@ modifier_C(VarParser *vp, char value[], Var *v) regfree(&patt.re); free(patt.matches); free(patt.rhs); - free(re); + free(patt.lhs); return (newValue); } |