[BusyBox] Re: [patch] Simplify the heck out of the sed newline hack.
Glenn McGrath
bug1 at optushome.com.au
Fri Sep 26 01:34:08 UTC 2003
On Thu, 25 Sep 2003 15:26:59 -0500
Rob Landley <rob at landley.net> wrote:
> Here's a test program to show that glibc regex is matching patterns
> containing newlines just fine. (I haven't tested uclibc regex, but if
> it doesn't work and glibc does, that's a bug and I'll fix it.)
>
> int main(int argc, char *argv[])
> {
> regex_t regex;
> regmatch_t match;
> // char grepstr[]="fred[123]ish";
> // char *string="abcfred2ishdef";
> char *grepstr="oom\nping";
> char *string="thingoom\npingb";
>
> printf("%d\n",regcomp(®ex, grepstr, REG_NEWLINE));
> printf("%d\n",regexec(®ex,string,1,&match,0));
> printf("%d %d\n",match.rm_so,match.rm_eo);
> }
Interesting, its definetly a bug in sed.c then, and the current newline
hack is the wrong approach.
Glenn
More information about the busybox
mailing list