From ae1e14d65b4e96c01a02e100a76d10c06b341df3 Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Tue, 20 Sep 2022 14:41:38 +0200 Subject: [PATCH] CLEANUP: tools: removing escape_chunk() function Func is not used anymore. See e3bde807d. --- include/haproxy/tools.h | 12 ------------ src/tools.c | 32 -------------------------------- 2 files changed, 44 deletions(-) diff --git a/include/haproxy/tools.h b/include/haproxy/tools.h index 948c7de8bf..f786e1a475 100644 --- a/include/haproxy/tools.h +++ b/include/haproxy/tools.h @@ -435,18 +435,6 @@ char *escape_string(char *start, char *stop, const char escape, const long *map, const char *string, const char *string_stop); -/* - * Tries to prefix characters tagged in the with the - * character. contains the input to be escaped. The result will be - * stored between (included) and (excluded). The function - * will always try to terminate the resulting string with a '\0' before - * , and will return its position if the conversion completes. - */ -char *escape_chunk(char *start, char *stop, - const char escape, const long *map, - const struct buffer *chunk); - - /* Check a string for using it in a CSV output format. If the string contains * one of the following four char <">, <,>, CR or LF, the string is * encapsulated between <"> and the <"> are escaped by a <""> sequence. diff --git a/src/tools.c b/src/tools.c index 8771d2dc8f..474b7df315 100644 --- a/src/tools.c +++ b/src/tools.c @@ -2004,38 +2004,6 @@ char *escape_string(char *start, char *stop, return start; } -/* - * Tries to prefix characters tagged in the with the - * character. contains the input to be escaped. The result will be - * stored between (included) and (excluded). The function - * will always try to terminate the resulting string with a '\0' before - * , and will return its position if the conversion completes. - */ -char *escape_chunk(char *start, char *stop, - const char escape, const long *map, - const struct buffer *chunk) -{ - char *str = chunk->area; - char *end = chunk->area + chunk->data; - - if (start < stop) { - stop--; /* reserve one byte for the final '\0' */ - while (start < stop && str < end) { - if (!ha_bit_test((unsigned char)(*str), map)) - *start++ = *str; - else { - if (start + 2 >= stop) - break; - *start++ = escape; - *start++ = *str; - } - str++; - } - *start = '\0'; - } - return start; -} - /* Check a string for using it in a CSV output format. If the string contains * one of the following four char <">, <,>, CR or LF, the string is * encapsulated between <"> and the <"> are escaped by a <""> sequence. -- 2.39.5