summaryrefslogtreecommitdiffabout
path: root/ui-tree.c
Unidiff
Diffstat (limited to 'ui-tree.c') (more/less context) (show whitespace changes)
-rw-r--r--ui-tree.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui-tree.c b/ui-tree.c
index c6159ec..553dbaa 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -22,18 +22,21 @@ static void print_text_buffer(char *buf, unsigned long size)
22 "<a class='no' id='n%1$d' name='n%1$d' href='#n%1$d'>%1$d</a>\n"; 22 "<a class='no' id='n%1$d' name='n%1$d' href='#n%1$d'>%1$d</a>\n";
23 23
24 html("<table summary='blob content' class='blob'>\n"); 24 html("<table summary='blob content' class='blob'>\n");
25 html("<tr><td class='linenumbers'><pre>"); 25 html("<tr><td class='linenumbers'><pre>");
26 idx = 0; 26 idx = 0;
27 lineno = 0; 27 lineno = 0;
28
29 if (size) {
28 htmlf(numberfmt, ++lineno); 30 htmlf(numberfmt, ++lineno);
29 while(idx < size - 1) { // skip absolute last newline 31 while(idx < size - 1) { // skip absolute last newline
30 if (buf[idx] == '\n') 32 if (buf[idx] == '\n')
31 htmlf(numberfmt, ++lineno); 33 htmlf(numberfmt, ++lineno);
32 idx++; 34 idx++;
33 } 35 }
36 }
34 html("</pre></td>\n"); 37 html("</pre></td>\n");
35 html("<td class='lines'><pre><code>"); 38 html("<td class='lines'><pre><code>");
36 html_txt(buf); 39 html_txt(buf);
37 html("</code></pre></td></tr></table>\n"); 40 html("</code></pre></td></tr></table>\n");
38} 41}
39 42