]> Savannah Git Hosting - gnulib.git/commitdiff
regex: redo style of previous change
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 19 Oct 2021 08:48:37 +0000 (01:48 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 19 Oct 2021 08:48:37 +0000 (01:48 -0700)
lib/regexec.c

index 106f9d7ff1087e418a595eee2fb838da819a2c54..6aeba3c0b4da23ccbc4fc7b7037377ba6428278a 100644 (file)
@@ -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;