author | Mark Lodato <lodatom@gmail.com> | 2010-09-04 18:18:16 (UTC) |
---|---|---|
committer | Mark Lodato <lodatom@gmail.com> | 2010-09-04 18:30:10 (UTC) |
commit | d187b98557d91b874836f286b955ba76ab26fb02 (patch) (unidiff) | |
tree | b8cf6224768c70c69450a7f6643393e342786594 /ui-tree.c | |
parent | 25e8ba1996a7b5ea291c924b0990d706176f6fe6 (diff) | |
download | cgit-d187b98557d91b874836f286b955ba76ab26fb02.zip cgit-d187b98557d91b874836f286b955ba76ab26fb02.tar.gz cgit-d187b98557d91b874836f286b955ba76ab26fb02.tar.bz2 |
prefer html_raw() to write()
To make the code more consistent, and to not rely on the implementation
of html(), always use html_raw(...) instead of write(htmlfd, ...).
Signed-off-by: Mark Lodato <lodatom@gmail.com>
-rw-r--r-- | ui-tree.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -33,33 +33,33 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size) | |||
33 | while(idx < size - 1) { // skip absolute last newline | 33 | while(idx < size - 1) { // skip absolute last newline |
34 | if (buf[idx] == '\n') | 34 | if (buf[idx] == '\n') |
35 | htmlf(numberfmt, ++lineno); | 35 | htmlf(numberfmt, ++lineno); |
36 | idx++; | 36 | idx++; |
37 | } | 37 | } |
38 | } | 38 | } |
39 | html("</pre></td>\n"); | 39 | html("</pre></td>\n"); |
40 | } | 40 | } |
41 | else { | 41 | else { |
42 | html("<tr>\n"); | 42 | html("<tr>\n"); |
43 | } | 43 | } |
44 | 44 | ||
45 | if (ctx.repo->source_filter) { | 45 | if (ctx.repo->source_filter) { |
46 | html("<td class='lines'><pre><code>"); | 46 | html("<td class='lines'><pre><code>"); |
47 | ctx.repo->source_filter->argv[1] = xstrdup(name); | 47 | ctx.repo->source_filter->argv[1] = xstrdup(name); |
48 | cgit_open_filter(ctx.repo->source_filter); | 48 | cgit_open_filter(ctx.repo->source_filter); |
49 | write(STDOUT_FILENO, buf, size); | 49 | html_raw(buf, size); |
50 | cgit_close_filter(ctx.repo->source_filter); | 50 | cgit_close_filter(ctx.repo->source_filter); |
51 | html("</code></pre></td></tr></table>\n"); | 51 | html("</code></pre></td></tr></table>\n"); |
52 | return; | 52 | return; |
53 | } | 53 | } |
54 | 54 | ||
55 | html("<td class='lines'><pre><code>"); | 55 | html("<td class='lines'><pre><code>"); |
56 | html_txt(buf); | 56 | html_txt(buf); |
57 | html("</code></pre></td></tr></table>\n"); | 57 | html("</code></pre></td></tr></table>\n"); |
58 | } | 58 | } |
59 | 59 | ||
60 | #define ROWLEN 32 | 60 | #define ROWLEN 32 |
61 | 61 | ||
62 | static void print_binary_buffer(char *buf, unsigned long size) | 62 | static void print_binary_buffer(char *buf, unsigned long size) |
63 | { | 63 | { |
64 | unsigned long ofs, idx; | 64 | unsigned long ofs, idx; |
65 | static char ascii[ROWLEN + 1]; | 65 | static char ascii[ROWLEN + 1]; |