miniexpect: Debug next_match field
authorRichard W.M. Jones <rjones@redhat.com>
Mon, 25 Jul 2022 15:01:10 +0000 (16:01 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Mon, 25 Jul 2022 15:01:10 +0000 (16:01 +0100)
miniexpect.c

index 7debc02..85826a0 100644 (file)
@@ -361,6 +361,9 @@ mexp_expect (mexp_h *h, const mexp_regexp *regexps, int *ovector, int ovecsize)
             h->next_match = ovector[1];
           else
             h->next_match = -1;
             h->next_match = ovector[1];
           else
             h->next_match = -1;
+          if (h->debug_fp)
+            fprintf (h->debug_fp, "DEBUG: next_match at buffer offset %zu\n",
+                     h->next_match);
           return regexps[i].r;
         }
 
           return regexps[i].r;
         }