diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/html.c22
1 file changed, 10 insertions, 12 deletions
diff --git a/source/html.c b/source/html.c
index 2e4ec66..2e3a3b7 100644
--- a/source/html.c
+++ b/source/html.c
@@ -3,10 +3,9 @@
* for page text, attribute values, URL paths and query arguments along with
* the small formatting helpers the rest of the code prints through. What is
* written here is gathered into one buffer and handed to stdout in whole
- * blocks, because a page is made of a great many small fragments and a write
- * apiece spent more time in the kernel than rendering the page did. cgit
- * shares stdout with the filters it runs and with git itself, so that buffer
- * has to be emptied wherever another writer takes over.
+ * blocks, since a page is made of a great many small fragments. cgit shares
+ * stdout with the filters it runs and with git itself, so that buffer has
+ * to be emptied wherever another writer takes over.
*/
#include "cgit.h"
@@ -57,9 +56,8 @@ static struct strbuf *capture;
static void write_out(const char *data, size_t size)
{
- // A blob, a snapshot or a patch reaches this with a size well past what
- // one write can move onto a pipe, so a short write is ordinary rather
- // than an error and has to be resumed instead of reported.
+ // A blob or snapshot is well past what one write can move onto a
+ // pipe, so short writes are resumed rather than reported.
if (write_in_full(STDOUT_FILENO, data, size) < 0)
die_errno("write error on html output");
}
@@ -256,11 +254,11 @@ void html_url_path(const char *txt)
const char *p = txt;
while (p && *p) {
unsigned char c = *p;
- // A raw ampersand or plus is legal in a URL path, but the
- // paths written here land in attribute values, where a bare
- // ampersand can start a character reference and quietly turn
- // "a&copy.txt" into a different filename. Encoding both keeps
- // the output byte-safe in every sink.
+ // A raw ampersand or plus is legal in a URL path, but this
+ // table is shared with html_url_arg, where a bare plus decodes
+ // back as a space, and the paths written here land in attribute
+ // values, where an ampersand can start a character reference
+ // and quietly turn "a&copy.txt" into a different filename.
const char *esc = url_escape_table[c];
if (esc) {
html_raw(txt, p - txt);