stagit-gopher

[fork] gopher git frontend
Log | Files | Refs | README | LICENSE

commit 4dcaa7f51f39d3cba5b7aaa91ef97d9921c15308
parent bb937f1c2b445f8278cca87af9cd60f11e735823
Author: hhvn <dev@hhvn.uk>
Date:   Fri, 11 Mar 2022 17:51:15 +0000

Don't use 't' to escape except before links

Diffstat:
Mstagit-gopher-index.c | 1-
Mstagit-gopher.c | 5+----
2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/stagit-gopher-index.c b/stagit-gopher-index.c @@ -163,7 +163,6 @@ void writeheader(FILE *fp) { if (description[0]) { - putchar('t'); gphtext(fp, description, strlen(description)); fputs("\n\n", fp); } diff --git a/stagit-gopher.c b/stagit-gopher.c @@ -454,7 +454,7 @@ gphtextnl(FILE *fp, const char *s, size_t len) for (i = 0; s[i] && i < len; i++) { /* escape with 't' at the start of a line */ - if (!n && (s[i] == 't' || s[i] == '[')) + if (!n && s[i] == '[') putc('t', fp); switch (s[i]) { @@ -582,7 +582,6 @@ printtimeshort(FILE *fp, const git_time *intime) void writeheader(FILE *fp, const char *title) { - putc('t', fp); gphtext(fp, title, strlen(title)); if (title[0] && strippedname[0]) fputs(" - ", fp); @@ -785,7 +784,6 @@ printshowfile(FILE *fp, struct commitinfo *ci) if (git_patch_get_hunk(&hunk, &nhunklines, patch, j)) break; - putc('t', fp); gphtext(fp, hunk->header, hunk->header_len); putc('\n', fp); @@ -1013,7 +1011,6 @@ writeblob(git_object *obj, const char *fpath, const char *filename, size_t files fp = efopen(fpath, "w"); writeheader(fp, filename); - putc('t', fp); gphtext(fp, filename, strlen(filename)); fprintf(fp, " (%zuB)\n", filesize); fputs("---\n", fp);