[master] 423452539 vtc: array not needed for token expansion

Nils Goroll nils.goroll at uplex.de
Sat Nov 17 11:25:16 UTC 2018


commit 4234525392f871b98d89f05e23202855828d3abe
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Sat Nov 17 12:15:44 2018 +0100

    vtc: array not needed for token expansion

diff --git a/bin/varnishtest/vtc.c b/bin/varnishtest/vtc.c
index 66a2f97f2..2ddb98cd3 100644
--- a/bin/varnishtest/vtc.c
+++ b/bin/varnishtest/vtc.c
@@ -302,7 +302,7 @@ parse_string(const char *spec, const struct cmds *cmd, void *priv,
     struct vtclog *vl)
 {
 	char *token_s[MAX_TOKENS], *token_e[MAX_TOKENS];
-	struct vsb *token_exp[MAX_TOKENS];
+	struct vsb *token_exp;
 	char *e, *p, *q, *f, *buf;
 	int nest_brace;
 	int tn;
@@ -401,14 +401,13 @@ parse_string(const char *spec, const struct cmds *cmd, void *priv,
 		assert(tn < MAX_TOKENS);
 		token_s[tn] = NULL;
 		for (tn = 0; token_s[tn] != NULL; tn++) {
-			token_exp[tn] = NULL;
 			AN(token_e[tn]);	/*lint !e771 */
 			*token_e[tn] = '\0';	/*lint !e771 */
 			if (NULL != strstr(token_s[tn], "${")) {
-				token_exp[tn] = macro_expand(vl, token_s[tn]);
+				token_exp = macro_expand(vl, token_s[tn]);
 				if (vtc_error)
 					return;
-				token_s[tn] = VSB_data(token_exp[tn]);
+				token_s[tn] = VSB_data(token_exp);
 				token_e[tn] = strchr(token_s[tn], '\0');
 			}
 		}


More information about the varnish-commit mailing list