|
|
@ -23,19 +23,24 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size)
|
|
|
|
|
|
|
|
|
|
|
|
html("<table summary='blob content' class='blob'>\n");
|
|
|
|
html("<table summary='blob content' class='blob'>\n");
|
|
|
|
|
|
|
|
|
|
|
|
html("<tr><td class='linenumbers'><pre>");
|
|
|
|
if (ctx.cfg.linenumbers) {
|
|
|
|
idx = 0;
|
|
|
|
html("<tr><td class='linenumbers'><pre>");
|
|
|
|
lineno = 0;
|
|
|
|
idx = 0;
|
|
|
|
|
|
|
|
lineno = 0;
|
|
|
|
if (size) {
|
|
|
|
|
|
|
|
htmlf(numberfmt, ++lineno);
|
|
|
|
if (size) {
|
|
|
|
while(idx < size - 1) { // skip absolute last newline
|
|
|
|
htmlf(numberfmt, ++lineno);
|
|
|
|
if (buf[idx] == '\n')
|
|
|
|
while(idx < size - 1) { // skip absolute last newline
|
|
|
|
htmlf(numberfmt, ++lineno);
|
|
|
|
if (buf[idx] == '\n')
|
|
|
|
idx++;
|
|
|
|
htmlf(numberfmt, ++lineno);
|
|
|
|
|
|
|
|
idx++;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
html("</pre></td>\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
html("<tr>\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
html("</pre></td>\n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ctx.repo->source_filter) {
|
|
|
|
if (ctx.repo->source_filter) {
|
|
|
|
html("<td class='lines'><pre><code>");
|
|
|
|
html("<td class='lines'><pre><code>");
|
|
|
|