[squid-dev] [PATCH] shell un-escaping squidclient -H option
Alex Rousskov
rousskov at measurement-factory.com
Thu May 19 20:52:17 UTC 2016
On 05/19/2016 07:51 AM, Amos Jeffries wrote:
> The squidclient -H parameter takes a string with some limited
> shellescaped characters. Currently just \n was expanded to the CRLF
> sequence. Other shell escaped characters were left untouched.
>
> However, to properly test headers containing weird CR, LF and HTAB
> positioning it needs to be able to receive these special characters
> individually and thus unescape them.
>
> Add a new function similar to perform shell unescape with special
> characters \r, \n, and \t. All other characters are un-escaped to
> themselves. Including '\\'.
I recommend warning about unsupported escapes (at least). This does not
count \\ that is/should be supported, of course.
> + unsigned char ch;
> +
> + while ((ch = *p)) {
It looks like you meant to simply say
while (unsigned char ch = *p) {
No objections to the patch either way -- I do not intend to review it.
Alex.
More information about the squid-dev
mailing list