From: Paul Eggert Date: Tue, 19 Oct 2021 08:48:37 +0000 (-0700) Subject: regex: redo style of previous change X-Git-Tag: v1.0~2569 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=3730e3b1e840c2bd9f52a51c0121b030b9a48f80;p=gnulib.git regex: redo style of previous change --- 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;