[PATCH] Use pathspec array correctly
authorJunio C Hamano <junkio@cox.net>
Wed, 25 May 2005 06:35:38 +0000 (23:35 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 25 May 2005 16:12:12 +0000 (09:12 -0700)
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>
diffcore-pathspec.c
index 4b7adc396a04076dbdd27ab5b9c0d7f420a2986c..78b3cb4c0a61f029bf6ccc3977933c2bef3303e3 100644 (file)
@@ -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;