diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c
index 574b3e833711fe3794636b86dbf2b9d9deb5e151..d0ef8397008824fb5139680856e3229ecf2c4eb1 100644 (file)
--- a/diffcore-pickaxe.c
+++ b/diffcore-pickaxe.c
regmatch_t regmatch;
int flags = 0;
+ assert(data[sz] == '\0');
while (*data && !regexec(regexp, data, 1, ®match, flags)) {
flags |= REG_NOTBOL;
- data += regmatch.rm_so;
- if (*data) data++;
+ data += regmatch.rm_eo;
+ if (*data && regmatch.rm_so == regmatch.rm_eo)
+ data++;
cnt++;
}