diff options
-rw-r--r-- | ui-tree.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/ui-tree.c b/ui-tree.c index 8c87571..26f06e3 100644 --- a/ui-tree.c +++ b/ui-tree.c | |||
@@ -13,7 +13,6 @@ | |||
13 | 13 | ||
14 | char *curr_rev; | 14 | char *curr_rev; |
15 | char *match_path; | 15 | char *match_path; |
16 | int header = 0; | ||
17 | static int state; | 16 | static int state; |
18 | 17 | ||
19 | static void print_text_buffer(const char *name, char *buf, unsigned long size) | 18 | static void print_text_buffer(const char *name, char *buf, unsigned long size) |
@@ -189,15 +188,11 @@ static void ls_head() | |||
189 | html("<th class='right'>Size</th>"); | 188 | html("<th class='right'>Size</th>"); |
190 | html("<th/>"); | 189 | html("<th/>"); |
191 | html("</tr>\n"); | 190 | html("</tr>\n"); |
192 | header = 1; | ||
193 | } | 191 | } |
194 | 192 | ||
195 | static void ls_tail() | 193 | static void ls_tail() |
196 | { | 194 | { |
197 | if (!header) | ||
198 | return; | ||
199 | html("</table>\n"); | 195 | html("</table>\n"); |
200 | header = 0; | ||
201 | } | 196 | } |
202 | 197 | ||
203 | static void ls_tree(const unsigned char *sha1, char *path) | 198 | static void ls_tree(const unsigned char *sha1, char *path) |
@@ -286,5 +281,6 @@ void cgit_print_tree(const char *rev, char *path) | |||
286 | match_path = path; | 281 | match_path = path; |
287 | state = 0; | 282 | state = 0; |
288 | read_tree_recursive(commit->tree, "", 0, 0, &paths, walk_tree, NULL); | 283 | read_tree_recursive(commit->tree, "", 0, 0, &paths, walk_tree, NULL); |
289 | ls_tail(); | 284 | if (state == 1) |
285 | ls_tail(); | ||
290 | } | 286 | } |