From 135b231160b4c4e25b70e9e31e6df2bcf9e12c56 Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Tue, 2 Sep 2008 00:53:04 +0200 Subject: ui-plain: handle subdirectories The callback from read_tree_recursive just needs to check the type of each tree entry; if it's a dir we want to continue scanning, if it's a regular file we'll assume it's the one we requested. And while at it, remove some stray fprintfs. Signed-off-by: Lars Hjemli --- ui-plain.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ui-plain.c b/ui-plain.c index 35888a0..be559e0 100644 --- a/ui-plain.c +++ b/ui-plain.c @@ -43,9 +43,7 @@ static int walk_tree(const unsigned char *sha1, const char *base, int baselen, const char *pathname, unsigned mode, int stage, void *cbdata) { - fprintf(stderr, "[cgit] walk_tree.pathname=%s", pathname); - - if (!pathname || strcmp(match_path, pathname)) + if (S_ISDIR(mode)) return READ_TREE_RECURSIVE; if (S_ISREG(mode)) @@ -75,7 +73,6 @@ void cgit_print_plain(struct cgit_context *ctx) return; } match_path = ctx->qry.path; - fprintf(stderr, "[cgit] match_path=%s", match_path); read_tree_recursive(commit->tree, NULL, 0, 0, paths, walk_tree, NULL); if (!match) html_status(404, "Not found", 0); -- cgit v1.2.3-54-g00ecf ?h=v1.2.2&id=e01229cf80bc618a132d2154c0ebd71792d31c64'>refslogtreecommitdiffstatshomepage
path: root/ui-summary.c
blob: a2c018e3087b8b70866a55f2de4a110a81dddc90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92