[master] 8ab29a0d5 Polish

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Tue Feb 18 05:37:06 UTC 2020


commit 8ab29a0d5690ac3c15a74d3d9865584cd02208b5
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Feb 18 06:34:25 2020 +0100

    Polish

diff --git a/lib/libvmod_cookie/vmod_cookie.c b/lib/libvmod_cookie/vmod_cookie.c
index 4187a1fb1..aaf5c1363 100644
--- a/lib/libvmod_cookie/vmod_cookie.c
+++ b/lib/libvmod_cookie/vmod_cookie.c
@@ -492,8 +492,8 @@ vmod_get_string(VRT_CTX, struct vmod_priv *priv)
 {
 	struct cookie *curr;
 	struct vsb output[1];
-	char *res;
 	struct vmod_cookie *vcp = cobj_get(priv);
+	const char *sep = "", *res;
 
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
 	CHECK_OBJ_NOTNULL(ctx->ws, WS_MAGIC);
@@ -503,9 +503,8 @@ vmod_get_string(VRT_CTX, struct vmod_priv *priv)
 		CHECK_OBJ_NOTNULL(curr, VMOD_COOKIE_ENTRY_MAGIC);
 		AN(curr->name);
 		AN(curr->value);
-		VSB_printf(output, "%s%s=%s;",
-		    (curr == VTAILQ_FIRST(&vcp->cookielist)) ? "" : " ",
-		    curr->name, curr->value);
+		VSB_printf(output, "%s%s=%s;", sep, curr->name, curr->value);
+		sep = " ";
 	}
 	res = WS_VSB_finish(output, ctx->ws, NULL);
 	if (res == NULL)


More information about the varnish-commit mailing list