phroxy

Gopher to HTTP proxy
git clone git://git.z3bra.org/phroxy.git
Log | Files | Refs | LICENSE

commit 3f1b87eb0e31a6f42bef4f4673ced6e446a2b335
parent 251225e03621f3ff7fd90af3683968ba2f7ed115
Author: Willy Goiffon <dev@z3bra.org>
Date:   Thu, 24 Sep 2020 10:08:44 +0200

Make menus preformatted

Diffstat:
Mphroxy.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/phroxy.c b/phroxy.c @@ -232,11 +232,12 @@ int printmenu(int fd, char *data) { char i, *p, a[LINE_MAX], *f[4]; - char *ifmt = "%s<br>\n"; - char *afmt = "<a href='http://%s/%s:%s/%c%s'>%s (%s)</a><br>\n"; + char *ifmt = "%s\n"; + char *afmt = "<a href='http://%s/%s:%s/%c%s'>%s (%s)</a>\n"; p = data; + write(fd, "<div style='white-space: pre-wrap'>\n", 36); while((p = strsep(&data, "\n"))) { i = *p++; @@ -257,6 +258,7 @@ printmenu(int fd, char *data) write(fd, a, strlen(a)); } + write(fd, "</div>\n", 7); return 0; }