]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- Fixed a bug when we were printing a non-existent "->" link as a part of the
authorrousskov <>
Sun, 22 Mar 1998 14:38:59 +0000 (14:38 +0000)
committerrousskov <>
Sun, 22 Mar 1998 14:38:59 +0000 (14:38 +0000)
  ftp dir entry. For example, the following should not lead to a coredump now:

l------rw-         747        0      747 Jan  8 19:31 .message

src/ftp.cc

index b7d604720359e1cec914c7c5653df5882474c3f9..8ba04b3410a00bca323661342d2f6f6f4a024111 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.209 1998/03/20 18:06:43 rousskov Exp $
+ * $Id: ftp.cc,v 1.210 1998/03/22 07:38:59 rousskov Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -643,9 +643,11 @@ ftpHtmlifyListEntry(char *line, FtpStateData * ftpState)
            rfc1738_escape(parts->name),
            parts->showname,
            dots_fill(strlen(parts->showname)));
-       snprintf(link2, 2048, "<A HREF=\"%s\">%s</A>",
-           rfc1738_escape(parts->link),
-           parts->link);
+       /* sometimes there is an 'l' flag, but no "->" link */
+       if (parts->link)
+           snprintf(link2, 2048, "<A HREF=\"%s\">%s</A>",
+               rfc1738_escape(parts->link),
+               parts->link);
        snprintf(html, 8192, "%s %s  [%s] -> %s\n",
            icon,
            link,