[pcre-dev] [Bug 781] pcreposix regexec shall set PCRE_NOTEMP…

Kezdőlap
Üzenet törlése
Szerző: Pascal MALAISE
Dátum:  
Címzett: pcre-dev
Tárgy: [pcre-dev] [Bug 781] pcreposix regexec shall set PCRE_NOTEMPTY
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=781




--- Comment #1 from Pascal MALAISE <malaise@???> 2008-11-01 11:32:18 ---
Moreover POSIX regexp makes the empty string match 'a?', which is not the case
with pcre when PCRE_NOTEMPTY is set.

So the 'correct' patch shall look like:

  else
    {
    so = 0;
    eo = strlen(string);
    }


+ if (so != eo) options |= PCRE_NOTEMPTY;

  rc = pcre_exec((const pcre *)preg->re_pcre, NULL, string + so, (eo - so),
    0, options, ovector, nmatch * 3);



--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email