[master] 42a7ecdd9 vcc_expr: Better spot to finalize string concatenation
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Wed Jul 10 08:44:08 UTC 2024
commit 42a7ecdd97a65a3f60408809e726e4160857fb26
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Wed Jul 10 10:39:19 2024 +0200
vcc_expr: Better spot to finalize string concatenation
diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c
index d1bb53ee6..e95a4de3e 100644
--- a/lib/libvcc/vcc_expr.c
+++ b/lib/libvcc/vcc_expr.c
@@ -1046,11 +1046,6 @@ vcc_expr_add(struct vcc *tl, struct expr **e, vcc_type_t fmt)
vcc_expr_mul(tl, e, fmt);
ERRCHK(tl);
- if (tl->t->tok != '+' && (*e)->fmt->stringform) {
- vcc_expr_tostring(tl, e);
- ERRCHK(tl);
- }
-
while (tl->t->tok == '+' || tl->t->tok == '-') {
tk = tl->t;
for (ap = vcc_adds; ap->op != EOI; ap++)
@@ -1100,6 +1095,10 @@ vcc_expr_add(struct vcc *tl, struct expr **e, vcc_type_t fmt)
return;
}
}
+
+ /* No concatenation, finalize string. */
+ if ((*e)->fmt->stringform)
+ vcc_expr_tostring(tl, e);
}
/*--------------------------------------------------------------------
More information about the varnish-commit
mailing list