Re: [pcre-dev] \l issue

Etusivu
Poista viesti
Lähettäjä: ph10
Päiväys:  
Vastaanottaja: Ze'ev Atlas
Kopio: Pcre Exim
Aihe: Re: [pcre-dev] \l issue
On Wed, 3 Jun 2015, Ze'ev Atlas wrote:

> Hi PhilipI enclose here my CHARTAB8 which is the EBCDIC equivalent of
> pcre_chartable.c.  I Believe that it would explain some of the
> different printouts.


> OTH, I could not find where PCRE discovers \L and rejects it, PCRE
> correctly fails in both EBCDIC and ASCII.  Similarly, I could not find
> where PCRE discovers \l and supposed to reject it as well but it does
> not and looks at it as if it was the charcter 'l'.  I need some
> guidance on it.  It looks like the last identified bug in the code.


Very odd, because the rejection of both happens together, in line 1043
of pcre_compile.c (in the current code), which reads like this:

  switch (c)
    {                                                                  
    /* A number of Perl escapes are not handled by PCRE. We give an explicit
    error. */                                                             


    case CHAR_l:                                                          
    case CHAR_L:                                                          
    *errorcodeptr = ERR37;                                    
    break;


So it looks as if somehow CHAR_l is being mis-defined. The definitions
happen in pcre_internal.h, not in the chartables. Here we find

#define CHAR_l                      'l'


for both ASCII & EBCDIC (when Unicode is not defined). The only other
possibility is that control is never reaching that code. This *does*
depend on various tables (see code around line 1013).

Aha! There is a bug in line 207 - in an EBCDIC table. The line reads

/*  90 */     0,     0, -ESC_k,     'l',      0, ESC_n,      0, -ESC_p,


Instead of 'l', there should be 0 (as there is for the L entry below).

If you can confirm that this fixes it, I'll change the master code. (I
am still having Internet issues, so my responses might be slow.)

Philip

--
Philip Hazel