procmail
[Top] [All Lists]

Re: if $MATCH starts with a newline

1997-11-20 14:24:12
Following up on Ed Sabol's patch,

| *** regexp.c    Fri Nov  7 16:15:01 1997
| --- regexp.c.new        Fri Nov  7 16:17:36 1997
| ***************
| *** 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,603 ----

I couldn't get patch to accept it for the 3.11pre7 code, so I edited it in
by hand (actually, I prepended "/*" to the "if" line) and recompiled.

It worked dandily.  If the pattern to the right of \/ matched text that began
with a real newline, it remained intact in $MATCH; a putative newline, whe-
ther it was matched by ^^, ^, or $, was duly dropped.

Thanks again, Ed.

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