mirror of
https://git.zx2c4.com/cgit
synced 2024-11-22 08:28:42 +00:00
ui-plain: fix to show a repo's root directory listing in plain view
This is to fix the case of accessing http://host.com/cgit.cgi/repo.git/plain/ There is code here to make this case work (match_baselen is set to -1 for top-of-the-tree views) but the unsigned to signed comparison was always false in this case, causing an empty directory listing without this fix. Signed-off-by: Joe Anakata <jea-signup-github@anakata.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
94c02bbf73
commit
de6098be6a
@ -143,7 +143,7 @@ static int walk_tree(const unsigned char *sha1, struct strbuf *base,
|
|||||||
walk_tree_ctx->match = 2;
|
walk_tree_ctx->match = 2;
|
||||||
return READ_TREE_RECURSIVE;
|
return READ_TREE_RECURSIVE;
|
||||||
}
|
}
|
||||||
} else if (base->len > walk_tree_ctx->match_baselen) {
|
} else if (base->len < INT_MAX && (int)base->len > walk_tree_ctx->match_baselen) {
|
||||||
print_dir_entry(sha1, base->buf, base->len, pathname, mode);
|
print_dir_entry(sha1, base->buf, base->len, pathname, mode);
|
||||||
walk_tree_ctx->match = 2;
|
walk_tree_ctx->match = 2;
|
||||||
} else if (S_ISDIR(mode)) {
|
} else if (S_ISDIR(mode)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user