tMake menus preformatted - phroxy - Gopher to HTTP proxy
 (HTM) git clone git://git.z3bra.org/phroxy.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 3f1b87eb0e31a6f42bef4f4673ced6e446a2b335
 (DIR) parent 251225e03621f3ff7fd90af3683968ba2f7ed115
 (HTM) Author: Willy Goiffon <dev@z3bra.org>
       Date:   Thu, 24 Sep 2020 10:08:44 +0200
       
       Make menus preformatted
       
       Diffstat:
         M phroxy.c                            |       6 ++++--
       
       1 file changed, 4 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/phroxy.c b/phroxy.c
       t@@ -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++;
        
       t@@ -257,6 +258,7 @@ printmenu(int fd, char *data)
        
                        write(fd, a, strlen(a));
                }
       +        write(fd, "</div>\n", 7);
        
                return 0;
        }