projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed bogus "<snap>" identifier.
[git.git]
/
diffcore-pathspec.c
diff --git
a/diffcore-pathspec.c
b/diffcore-pathspec.c
index
a48acbc
..
139fe88
100644
(file)
--- a/
diffcore-pathspec.c
+++ b/
diffcore-pathspec.c
@@
-29,6
+29,8
@@
static int matches_pathspec(const char *name, struct path_spec *s, int cnt)
name[len] == 0 ||
name[len] == '/')
return 1;
name[len] == 0 ||
name[len] == '/')
return 1;
+ if (!len)
+ return 1;
}
return 0;
}
}
return 0;
}
@@
-46,6
+48,9
@@
void diffcore_pathspec(const char **pathspec)
for (i = 0; pathspec[i]; i++)
;
speccnt = i;
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];
spec = xmalloc(sizeof(*spec) * speccnt);
for (i = 0; pathspec[i]; i++) {
spec[i].spec = pathspec[i];