]> mj.ucw.cz Git - libucw.git/blobdiff - lib/url.c
Allow locked dirty pages. Better debugging. Simplified and cleaned up
[libucw.git] / 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 = "/";
   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;
 }
     *c = 0;
   return 0;
 }