FreeBSD Bugzilla – Attachment 172418 Details for
Bug 201650
(e)grep handling regexp wrong
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for fixing anchor treatment in BSD grep.
bsdgrep-anchor.diff (text/plain), 832 bytes, created by
Daniël de Kok
on 2016-07-12 17:31:12 UTC
(
hide
)
Description:
Patch for fixing anchor treatment in BSD grep.
Filename:
MIME Type:
Creator:
Daniël de Kok
Created:
2016-07-12 17:31:12 UTC
Size:
832 bytes
patch
obsolete
>--- util.c.orig 2016-07-12 20:38:58.493538000 +0200 >+++ util.c 2016-07-12 20:42:49.871234000 +0200 >@@ -281,14 +281,19 @@ > pmatch.rm_so = st; > pmatch.rm_eo = l->len; > >+ /* Position-adjusted eflags, if we are beyond the first >+ character, we have to set REG_NOTBOL to ensure that >+ anchors are handled correctly. */ >+ int peflags = eflags | (st == 0 ? 0 : REG_NOTBOL); >+ > /* Loop to compare with all the patterns */ > for (i = 0; i < patterns; i++) { > if (fg_pattern[i].pattern) > r = fastexec(&fg_pattern[i], >- l->dat, 1, &pmatch, eflags); >+ l->dat, 1, &pmatch, peflags); > else > r = regexec(&r_pattern[i], l->dat, 1, >- &pmatch, eflags); >+ &pmatch, peflags); > r = (r == 0) ? 0 : REG_NOMATCH; > st = (cflags & REG_NOSUB) > ? (size_t)l->len
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 201650
: 172418