diff options
Diffstat (limited to 'diffcore-pathspec.c')
-rw-r--r-- | diffcore-pathspec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/diffcore-pathspec.c b/diffcore-pathspec.c index 68fe00913..139fe882f 100644 --- a/diffcore-pathspec.c +++ b/diffcore-pathspec.c @@ -48,6 +48,9 @@ void diffcore_pathspec(const char **pathspec) for (i = 0; pathspec[i]; i++) ; speccnt = i; + if (!speccnt) + return; + spec = xmalloc(sizeof(*spec) * speccnt); for (i = 0; pathspec[i]; i++) { spec[i].spec = pathspec[i]; |