diff --git a/doc/management.txt b/doc/management.txt index d3a2e1a0e..f559ffc86 100644 --- a/doc/management.txt +++ b/doc/management.txt @@ -1239,6 +1239,9 @@ example : # echo "show info;show stat;show table" | socat /var/run/haproxy stdio +If a command needs to use a semi-colon (eg: in a value), it must be preceeded +by a backslash ('\'). + The interactive mode displays a prompt ('>') and waits for commands to be entered on the line, then processes them, and displays the prompt again to wait for a new command. This mode is entered via the "prompt" command which must be diff --git a/src/dumpstats.c b/src/dumpstats.c index 6c8e3ee57..b42c07aa9 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -2656,15 +2656,20 @@ static void cli_io_handler(struct appctx *appctx) continue; } - /* seek for a possible semi-colon. If we find one, we - * replace it with an LF and skip only this part. + /* seek for a possible unescaped semi-colon. If we find + * one, we replace it with an LF and skip only this part. */ - for (len = 0; len < reql; len++) + for (len = 0; len < reql; len++) { + if (trash.str[len] == '\\') { + len++; + continue; + } if (trash.str[len] == ';') { trash.str[len] = '\n'; reql = len + 1; break; } + } /* now it is time to check that we have a full line, * remove the trailing \n and possibly \r, then cut the