procmail
[Top] [All Lists]

Re: Different result with ()\/^.*string and ^\/.*string

1997-11-18 18:14:20
Rik Kabel <rik(_at_)netcom(_dot_)com> writes:
Another match anomaly. This one occured in my rc, and I was able to
reproduce it in a smaller environment for all to see. This behaves the
same under both v3.11pre4 and v3.11pre7.

This is a known bug in all versions of procmail that support matching.
Here's a patch against 3.11pre7:

*** src/regexp.c        1997/04/04 07:28:42     1.1.1.2
--- src/regexp.c        1997/10/20 19:53:00
***************
*** 598,605 ****
           tmemmove(q=(char*)text,bom,len),q[len]='\0',bom=q;
        else
         { char*p;
!          if(*bom=='\n')
!             bom++;                            /* strip one leading newline */
           primeStdout(amatch);p=realloc(Stdout,(Stdfilled+=len)+1);
           tmemmove(q=p+Stdfilled-(int)len,bom,len);retbStdout(p);
         }
--- 598,605 ----
           tmemmove(q=(char*)text,bom,len),q[len]='\0',bom=q;
        else
         { char*p;
!          if(*bom=='\n'&&len)
!           { bom++;len--;}                     /* strip one leading newline */
           primeStdout(amatch);p=realloc(Stdout,(Stdfilled+=len)+1);
           tmemmove(q=p+Stdfilled-(int)len,bom,len);retbStdout(p);
         }


Yes, it's already been submitted to the author.

Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>