X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=diffcore-pickaxe.c;h=c4a77d71da5602b68c541c2487fcbecfdfff2944;hb=1654a3ba0c3a91ee3c0f38c922e3d2d1255ec868;hp=cfcce315babb0edb7ad7be7f2ab2437aaf41eb9d;hpb=d69dc373cbf58d88d19dcbc6cff37e12b17f8fd2;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; }