From: guenther Date: Fri, 23 May 2014 19:49:15 +0000 (+0000) Subject: Use REG_STARTEND to permit searches to work past/across NUL bytes. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d2a22d617da362b2fca8f24d577709d279b25c5b;p=openbsd Use REG_STARTEND to permit searches to work past/across NUL bytes. ok millert@ shadchin@ --- diff --git a/usr.bin/less/pattern.c b/usr.bin/less/pattern.c index dc3ef786960..fd1fcf5f768 100644 --- 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) {