summaryrefslogtreecommitdiffstats
path: root/usr.bin/grep/regex
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/grep/regex')
-rw-r--r--usr.bin/grep/regex/glue.h2
-rw-r--r--usr.bin/grep/regex/tre-fastmatch.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/grep/regex/glue.h b/usr.bin/grep/regex/glue.h
index 2fea4fd..0c54e98 100644
--- a/usr.bin/grep/regex/glue.h
+++ b/usr.bin/grep/regex/glue.h
@@ -50,7 +50,7 @@ typedef enum { STR_WIDE, STR_BYTE, STR_MBS, STR_USER } tre_str_type_t;
if ((long long)pmatch[0].rm_eo - pmatch[0].rm_so < 0) \
return REG_NOMATCH; \
ret = fn; \
- for (unsigned i = 0; (!(eflags & REG_NOSUB) && (i < nmatch)); i++)\
+ for (unsigned i = 0; (!preg->nosub && (i < nmatch)); i++) \
{ \
pmatch[i].rm_so += offset; \
pmatch[i].rm_eo += offset; \
diff --git a/usr.bin/grep/regex/tre-fastmatch.c b/usr.bin/grep/regex/tre-fastmatch.c
index 0881c55..08e17c7 100644
--- a/usr.bin/grep/regex/tre-fastmatch.c
+++ b/usr.bin/grep/regex/tre-fastmatch.c
@@ -621,7 +621,7 @@ tre_compile_fast(fastmatch_t *fg, const tre_char_t *pat, size_t n,
case TRE_CHAR('+'):
case TRE_CHAR('?'):
if ((cflags & REG_EXTENDED) && (i == 0))
- continue;
+ goto badpat;
else if ((cflags & REG_EXTENDED) ^ !escaped)
STORE_CHAR;
else
OpenPOWER on IntegriCloud