tDo not shorten path, if base is empty. - geomyidae - A small C-based gopherd. (gopher://bitreich.org/1/scm/geomyidae)
 (HTM) git clone git://r-36.net/geomyidae
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 828c9cc5ebc09271b73a3847aede892168d64765
 (DIR) parent 6c9e39e916f752250680a56bc2dad229c040af7a
 (HTM) Author: Christoph Lohmann <20h@r-36.net>
       Date:   Sun, 26 Apr 2020 12:31:10 +0200
       
       Do not shorten path, if base is empty.
       
       Diffstat:
         handlr.c                            |       3 ++-
       
       1 file changed, 2 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/handlr.c b/handlr.c
       t@@ -40,7 +40,8 @@ handledir(int sock, char *path, char *port, char *base, char *args,
                par = xstrdup(pa);
                b = strrchr(par + strlen(base), '/');
                if (b != NULL) {
       -                *b = '\0';
       +                if (strlen(par) > 1)
       +                        *b = '\0';
                        dprintf(sock, "1..\t%s\t%s\t%s\r\n",
                                par + strlen(base), ohost, port);
                }