[PATCH] ui-ssdiff: get rid of strncat

2019-01-01 Thread Eric Wong
strncat is slow and error-prone, use the git strbuf API instead. We can steal much of our logic from git/pretty.c::strbuf_add_tabexpand, but maybe keep the invalid characters for now *shrug*. --- ui-ssdiff.c | 58 +++-- 1 file changed, 25

Re: [PATCH] ui-shared: fix segfault in cgit_set_title_from_path

2019-01-01 Thread Jason A. Donenfeld
Hah, bad timing, I just rewrote this myself and was about to push. But thanks anyway! ___ CGit mailing list CGit@lists.zx2c4.com https://lists.zx2c4.com/mailman/listinfo/cgit

[PATCH] ui-shared: fix segfault in cgit_set_title_from_path

2019-01-01 Thread Eric Wong
The following invocation of strncat uses a bogus size and caused segfaults on my system: strncat(new_title, ctx.page.title, sizeof(new_title) - strlen(new_title) - 1); Since str*cat functions are all bug-prone and slow (need to search for '\0' at every invocation), switch to the safer and

[PATCH 4/4] ui-diff: preserve spaces w/o CSS on context lines

2019-01-01 Thread Eric Wong
We need to use a non-breaking space entity to preserve spacing for browsers without CSS support. --- html.c| 46 ++ html.h| 1 + ui-diff.c | 5 + 3 files changed, 48 insertions(+), 4 deletions(-) diff --git a/html.c b/html.c index

[PATCH 3/4] ui-log: improve decoration display for browsers without CSS

2019-01-01 Thread Eric Wong
Text-based browsers without CSS support show all the decorations bunched together without spacing. Rely on a whitespace instead of CSS support. --- cgit.css | 1 - ui-log.c | 5 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cgit.css b/cgit.css index 9f70d14..6fcd984 100644

[PATCH 1/4] ui-shared: improve pageheader display on text-based browsers

2019-01-01 Thread Eric Wong
Text-based browsers (and some GUI browsers such as dillo) display the pageheader as: "summaryrefslogtreecommitdiff" This is difficult-to-read. Improve accessibility for users who cannot run memory-hungry browsers by using whitespace instead of relying on CSS. --- cgit.css| 1 -

[PATCH 0/4] improve rendering w/o CSS reliance

2019-01-01 Thread Eric Wong
Here are a few changes to improve rendering for people with low-end machines using text-based browsers (w3m, lynx) or lightweight GUI browsers such as dillo, which has incomplete CSS support. The only incompatible (with existing CSS customisations) change might be the one to use instead of for