From 3730e3b1e840c2bd9f52a51c0121b030b9a48f80 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 19 Oct 2021 01:48:37 -0700 Subject: [PATCH] regex: redo style of previous change --- lib/regexec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/regexec.c b/lib/regexec.c index 106f9d7ff1..6aeba3c0b4 100644 --- a/lib/regexec.c +++ b/lib/regexec.c @@ -758,9 +758,9 @@ re_search_internal (const regex_t *preg, const char *string, Idx length, offset = match_first - mctx.input.raw_mbs_idx; } - /* If OFFSET is out of the buffer, leave CH as '\0'. */ - ch = (mctx.input.valid_len <= offset - ? 0 : re_string_byte_at (&mctx.input, offset)); + /* Use buffer byte if OFFSET is in buffer, otherwise '\0'. */ + ch = (offset < mctx.input.valid_len + ? re_string_byte_at (&mctx.input, offset) : 0); if (fastmap[ch]) break; match_first += incr; -- 2.39.5