artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0a8bc8f
)
Use REG_STARTEND to permit searches to work past/across NUL bytes.
author
guenther
<guenther@openbsd.org>
Fri, 23 May 2014 19:49:15 +0000
(19:49 +0000)
committer
guenther
<guenther@openbsd.org>
Fri, 23 May 2014 19:49:15 +0000
(19:49 +0000)
ok millert@ shadchin@
usr.bin/less/pattern.c
patch
|
blob
|
history
diff --git
a/usr.bin/less/pattern.c
b/usr.bin/less/pattern.c
index
dc3ef78
..
fd1fcf5
100644
(file)
--- a/
usr.bin/less/pattern.c
+++ b/
usr.bin/less/pattern.c
@@
-306,6
+306,11
@@
match_pattern(pattern, tpattern, line, line_len, sp, ep, notbol, search_type)
{
regmatch_t rm;
int flags = (notbol) ? REG_NOTBOL : 0;
+#ifdef REG_STARTEND
+ flags |= REG_STARTEND;
+ rm.rm_so = 0;
+ rm.rm_eo = line_len;
+#endif
matched = !regexec(spattern, line, 1, &rm, flags);
if (matched)
{