]> asedeno.scripts.mit.edu Git - git.git/blobdiff - dir.c
git-svn: Don't rely on $_ after making a function call
[git.git] / dir.c
diff --git a/dir.c b/dir.c
index 32b57f0125d1b9e95345eb23a9a32fbf8444b1b8..602282bd1b198a7a0cef0707c738b4eda0d3ccef 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -24,8 +24,9 @@ int common_prefix(const char **pathspec)
        prefix = slash - path + 1;
        while ((next = *++pathspec) != NULL) {
                int len = strlen(next);
-               if (len >= prefix && !memcmp(path, next, len))
+               if (len >= prefix && !memcmp(path, next, prefix))
                        continue;
+               len = prefix - 1;
                for (;;) {
                        if (!len)
                                return 0;
@@ -130,13 +131,13 @@ static int add_excludes_from_file_1(const char *fname,
 {
        struct stat st;
        int fd, i;
-       long size;
+       size_t size;
        char *buf, *entry;
 
        fd = open(fname, O_RDONLY);
        if (fd < 0 || fstat(fd, &st) < 0)
                goto err;
-       size = st.st_size;
+       size = xsize_t(st.st_size);
        if (size == 0) {
                close(fd);
                return 0;