Re: [pcre-dev] Handling \E in char classes?

Kezdőlap
Üzenet törlése
Szerző: Philip Hazel
Dátum:  
Címzett: Stepan Kasal
CC: pcre-dev
Tárgy: Re: [pcre-dev] Handling \E in char classes?
On Tue, 20 Nov 2007, Stepan Kasal wrote:

> In compile_branch, the code for handling \E in character classes
> (square brackets) looks like this:
>
> --- quote ---
>       if (c == '\\')
>         {
>         c = check_escape(&ptr, errorcodeptr, cd->bracount, options, TRUE);
>    ...
>    else if (-c == ESC_E) continue;  /* Ignore orphan \E */

>
>       if (c < 0)
>           {
>           ...
>           if (lengthptr == NULL) switch (-c)
>             {
>             ...
>             case ESC_E: /* Perl ignores an orphan \E */
>             continue;
> --- quote ---

>
> I think the second occurence of ESC_E is redundant; the second big `if' can not
> be entered with -c == ESC_E.
> What am I missing?


Nothing. It looks as though I forgot to remove the second ESC_E when I
re-did the memory handling and that test ended up inside lengthptr test
(so had to be moved outside). I've committed a patch that removes those
two lines.


Philip

--
Philip Hazel