* regex_internal.c (re_string_context_at): Fix bug where the
[gnulib.git] / lib / regex_internal.c
index 24c61ec..57ba44d 100644 (file)
@@ -843,10 +843,10 @@ re_string_context_at (const re_string_t *input, Idx idx, int eflags)
        {
 #ifdef DEBUG
          /* It must not happen.  */
-         assert (wc_idx >= 0);
+         assert (REG_VALID_INDEX (wc_idx));
 #endif
          --wc_idx;
-         if (wc_idx < 0)
+         if (! REG_VALID_INDEX (wc_idx))
            return input->tip_context;
        }
       wc = input->wcs[wc_idx];