X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/942a4c200168e110ec009c3260dc5f5f050de325..03389d6e67bfda5cb3ff1504db815f09715ec6f4:/ui-tree.c diff --git a/ui-tree.c b/ui-tree.c index c6159ec..7bf2ad2 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -15,23 +15,38 @@ char *curr_rev; char *match_path; int header = 0; -static void print_text_buffer(char *buf, unsigned long size) +static void print_text_buffer(const char *name, char *buf, unsigned long size) { unsigned long lineno, idx; const char *numberfmt = "%1$d\n"; html("
");
idx = 0;
lineno = 0;
- htmlf(numberfmt, ++lineno);
- while(idx < size - 1) { // skip absolute last newline
- if (buf[idx] == '\n')
- htmlf(numberfmt, ++lineno);
- idx++;
+
+ if (size) {
+ htmlf(numberfmt, ++lineno);
+ while(idx < size - 1) { // skip absolute last newline
+ if (buf[idx] == '\n')
+ htmlf(numberfmt, ++lineno);
+ idx++;
+ }
}
html(" | \n");
+
+ if (ctx.repo->source_filter) {
+ html(" |
");
html_txt(buf);
html("