summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2014-04-12 01:01:20 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2014-04-12 01:01:20 +0000
commit28c339b8b317d59a5c65ac0c6044b20058ae7f2e (patch)
treea96345f9927039539335c94d08567fd35c7233f4
parentb410ad7a403db3dd8abcc9bdca0ac2d2d8ffe73a (diff)
Unlike less, more should use basic regular expressions.
OK schwarze@
-rw-r--r--usr.bin/less/pattern.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/less/pattern.c b/usr.bin/less/pattern.c
index ca349b6c192..32824c08040 100644
--- a/usr.bin/less/pattern.c
+++ b/usr.bin/less/pattern.c
@@ -16,6 +16,7 @@
#include "pattern.h"
extern int caseless;
+extern int less_is_more;
/*
* Compile a search pattern, for future use by match_pattern.
@@ -31,7 +32,7 @@ compile_pattern2(pattern, search_type, comp_pattern)
#if HAVE_POSIX_REGCOMP
regex_t *comp = (regex_t *) ecalloc(1, sizeof(regex_t));
regex_t **pcomp = (regex_t **) comp_pattern;
- if (regcomp(comp, pattern, REGCOMP_FLAG))
+ if (regcomp(comp, pattern, less_is_more ? 0 : REGCOMP_FLAG))
{
free(comp);
error("Invalid pattern", NULL_PARG);