Re: backslashes in config and change of strwordtok()

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 26 Jan 2005 00:08:47 +0100 (CET)

On Wed, 26 Jan 2005, Evgeny Kotsuba wrote:

> What is the reason for last changes in strwordtok() (tools.c /tools.cc) ?

To support the external_acl protocol in a more robust manner.

> I.e is it now
> * Similar to strtok, but has some rudimentary knowledge of quoting
> or it makes something more ?
>
> This changes with case '\\': boke possibilitiy to put in config paths
> with backslashes i.e.. native form of paths for OS/2 and Windows. The
> worse thing is that it is with paths like C:\Squid\auth\ncsa_auth.exe
> or C:\Squid\redirect.exe but not mention anywere in config and/or docs
> How often '\n' and '\r' are used in config ?

On windows you can use / instead of \. Not sure aboout OS/2.

On all using you can use \\ instead of \

And it is not a new change, strwordtok has behaved like this for as long
as it existed (Sep 2002). The only new change is that it now (Aug 2004)
decodes \n and \r into NL / CR instead of bare 'n' / 'r'.

The main reason why strwordtok is used when parsing helper paths etc is to
allow for specifications of paths or arguments with spaces in them. In
addition it may in some extreme cases be meaningful to be able to specify
NL / CR characters in the argument strings to the helpers (but not in the
path if the administrator has any sane mind..)

Regards
Henrik
Received on Tue Jan 25 2005 - 16:08:48 MST

This archive was generated by hypermail pre-2.1.9 : Tue Feb 01 2005 - 12:00:02 MST