X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=diffcore-pickaxe.c;h=c4a77d71da5602b68c541c2487fcbecfdfff2944;hb=1d431b22357389d0833830daf814ff0c4dc9189d;hp=cfcce315babb0edb7ad7be7f2ab2437aaf41eb9d;hpb=67e31d6234c0332334d7aedd70b2f101bc010cf9;p=git.git diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c index cfcce315b..c4a77d71d 100644 --- a/diffcore-pickaxe.c +++ b/diffcore-pickaxe.c @@ -5,8 +5,6 @@ #include "diff.h" #include "diffcore.h" -#include - static unsigned int contains(struct diff_filespec *one, const char *needle, unsigned long len, regex_t *regexp) @@ -16,6 +14,8 @@ static unsigned int contains(struct diff_filespec *one, const char *data; if (diff_populate_filespec(one, 0)) return 0; + if (!len) + return 0; sz = one->size; data = one->data; @@ -44,6 +44,7 @@ static unsigned int contains(struct diff_filespec *one, } } } + diff_free_filespec_data(one); return cnt; }