summaryrefslogtreecommitdiff
path: root/diffcore-pathspec.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-05-25 06:35:38 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-25 16:12:12 (GMT)
commitf4d89f26cec4e2de3abde7fb2ab3aed8840d5435 (patch)
tree95f29bec135aaea5f56630d9ab184129e31d38f5 /diffcore-pathspec.c
parentea84480f01406a0779d2932bb53f35f366ca0e6c (diff)
downloadgit-f4d89f26cec4e2de3abde7fb2ab3aed8840d5435.zip
git-f4d89f26cec4e2de3abde7fb2ab3aed8840d5435.tar.gz
git-f4d89f26cec4e2de3abde7fb2ab3aed8840d5435.tar.bz2
[PATCH] Use pathspec array correctly
Oh, I am an idiot. Repeating the same check against the first element of pathspec array as many times as the pathspec array has elements in it would not do us any good. This patch allows you to specify more than one pathspec to diff-tree family and have them actually used. Signed-off-by: Junio C Hamano <junkio@cox.net> ;) Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'diffcore-pathspec.c')
-rw-r--r--diffcore-pathspec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/diffcore-pathspec.c b/diffcore-pathspec.c
index 4b7adc3..78b3cb4 100644
--- a/diffcore-pathspec.c
+++ b/diffcore-pathspec.c
@@ -21,8 +21,8 @@ static int matches_pathspec(const char *name, struct path_spec *s, int cnt)
namelen = strlen(name);
for (i = 0; i < cnt; i++) {
- int len = s->len;
- if (! strncmp(s->spec, name, len) &&
+ int len = s[i].len;
+ if (! strncmp(s[i].spec, name, len) &&
len <= namelen &&
(name[len] == 0 || name[len] == '/'))
return 1;