]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: tools: removing escape_chunk() function
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 20 Sep 2022 12:41:38 +0000 (14:41 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 20 Sep 2022 14:25:30 +0000 (16:25 +0200)
    Func is not used anymore. See e3bde807d.

include/haproxy/tools.h
src/tools.c

index 948c7de8bf1276b5c2156c820eff30dd86603218..f786e1a475c7b1e67dd15b828d3359233c874b88 100644 (file)
@@ -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 <map> with the <escape>
- * character. <chunk> contains the input to be escaped. The result will be
- * stored between <start> (included) and <stop> (excluded). The function
- * will always try to terminate the resulting string with a '\0' before
- * <stop>, 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.
index 8771d2dc8f51d9f8804b28a8f7e0c39426b2f3d8..474b7df315cc78866a875e74ddeb956dc44d7e8a 100644 (file)
@@ -2004,38 +2004,6 @@ char *escape_string(char *start, char *stop,
        return start;
 }
 
-/*
- * Tries to prefix characters tagged in the <map> with the <escape>
- * character. <chunk> contains the input to be escaped. The result will be
- * stored between <start> (included) and <stop> (excluded). The function
- * will always try to terminate the resulting string with a '\0' before
- * <stop>, 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.