From 00cc6351fd4a0cdf216eba3cc4918aa3c7aa0704 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Tue, 8 Feb 2022 21:25:51 +0100 Subject: Small fix. --- src/cregex.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/cregex.c b/src/cregex.c index b07f9bfd..6d48e696 100644 --- a/src/cregex.c +++ b/src/cregex.c @@ -166,7 +166,7 @@ typedef struct Reljunk { Relist* relist[2]; Relist* reliste[2]; - Token starttype; + int starttype; Rune startchar; const char* starts; const char* eol; @@ -326,8 +326,8 @@ typedef struct Parser short cursubid; /* id of current subexpression */ int errors; Reflags flags; - Token dot_type; - Token rune_type; + int dot_type; + int rune_type; bool lastwasand; /* Last token was operand */ bool lexdone; short nbra; @@ -1078,8 +1078,9 @@ regexec9(const Reprog *progp, /* program to run */ j.starttype = 0; j.startchar = 0; - if (progp->startinst->type == RUNE && progp->startinst->r.rune < 128) { - j.starttype = RUNE; + int rune_type = progp->flags.caseless ? IRUNE : RUNE; + if (progp->startinst->type == rune_type && progp->startinst->r.rune < 128) { + j.starttype = rune_type; j.startchar = progp->startinst->r.rune; } if (progp->startinst->type == BOL) -- cgit v1.2.3