]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-plain.c
CGIT 0.8.2.2
[ps-cgit] / ui-plain.c
index be559e02e5192606e6ceccda40c2b05afaf70862..e08b15be1a85e46532623868640a49aea2a7f384 100644 (file)
@@ -18,7 +18,7 @@ static void print_object(const unsigned char *sha1, const char *path)
 {
        enum object_type type;
        char *buf;
-       size_t size;
+       unsigned long size;
 
        type = sha1_object_info(sha1, &size);
        if (type == OBJ_BAD) {
@@ -46,7 +46,8 @@ static int walk_tree(const unsigned char *sha1, const char *base, int baselen,
        if (S_ISDIR(mode))
                return READ_TREE_RECURSIVE;
 
-       if (S_ISREG(mode))
+       if (S_ISREG(mode) && !strncmp(base, match_path, baselen) &&
+           !strcmp(pathname, match_path + baselen))
                print_object(sha1, pathname);
 
        return 0;