]> mj.ucw.cz Git - libucw.git/commitdiff
Don't kill fragment references if there aren't any.
authorMartin Mares <mj@ucw.cz>
Sun, 24 Oct 1999 20:14:51 +0000 (20:14 +0000)
committerMartin Mares <mj@ucw.cz>
Sun, 24 Oct 1999 20:14:51 +0000 (20:14 +0000)
lib/url.c

index 9b031694ef09613f7ca36327399c3dc6475cbb45..3c1a0b8b3b5196b8dc14a1f2b5b9ca371d2091c4 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -375,7 +375,7 @@ url_canonicalize(struct url *u)
   kill_end_dot(u->host);
   if ((!u->rest || !*u->rest) && url_proto_path_flags[u->protoid])
     u->rest = "/";
-  if (c = strchr(u->rest, '#'))                /* Kill fragment reference */
+  if (u->rest && (c = strchr(u->rest, '#')))   /* Kill fragment reference */
     *c = 0;
   return 0;
 }