From 620072bc0d28d4bf88968295ffe7152838aab038 Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Fri, 12 Apr 2019 16:09:25 +0200 Subject: [PATCH] MINOR: cli: don't add a semicolon at the end of HAPROXY_CLI Only add the semicolon when there is several CLI in HAPROXY_CLI and HAPROXY_MASTER_CLI. --- src/cli.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cli.c b/src/cli.c index e21c7d21b..568ceba2e 100644 --- a/src/cli.c +++ b/src/cli.c @@ -391,6 +391,10 @@ int listeners_setenv(struct proxy *frontend, const char *varname) char addr[46]; char port[6]; + /* separate listener by semicolons */ + if (trash->data) + chunk_appendf(trash, ";"); + if (l->addr.ss_family == AF_UNIX) { const struct sockaddr_un *un; @@ -411,8 +415,6 @@ int listeners_setenv(struct proxy *frontend, const char *varname) } else if (l->addr.ss_family == AF_CUST_SOCKPAIR) { chunk_appendf(trash, "sockpair@%d", ((struct sockaddr_in *)&l->addr)->sin_addr.s_addr); } - /* separate listener by semicolons */ - trash->area[trash->data++] = ';'; } } trash->area[trash->data++] = '\0';