evaluate.c & strings with "\" in them

Phil Mayers p.mayers at imperial.ac.uk
Thu Oct 11 13:31:36 CEST 2012


On 11/10/12 11:29, Brian Candler wrote:
> On Wed, Oct 10, 2012 at 06:51:17PM +0100, Phil Mayers wrote:
>> The other thing is, do we actually need to handle "\" inside // at
>> all, with the exception of escaping the regex delimiter?
>
> I think even then, you would also need to treat backslash backslash as a
> single backslash.

Sure.

>
> Reason: imagine you wanted to match a a backslash followed by a forward
> slash.  The RE couldn't be \/ because that would be just the escaped forward
> slash, so it would have to be \\/.  Hence every instance of a single
> backslash needs to be escaped.
>
> But backslash followed by any other character could be passed straight
> through, e.g. \n is "\" and "n".
>
> The other question is, do we want escape sequences like \n for newline and
> \xHH for an arbitrary byte?

Isn't that the same question as the previous one?


More information about the Freeradius-Devel mailing list