X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=lib%2Furl.c;h=ac7fd8b7e6ede31514564628c6537d9fea38a51a;hb=b53b0576a2325cd6b81625a3b9ad3f91f0b7a249;hp=9b031694ef09613f7ca36327399c3dc6475cbb45;hpb=bf285ff821b06bf89d0301bc2f1623ce4ee44869;p=libucw.git diff --git a/lib/url.c b/lib/url.c index 9b031694..ac7fd8b7 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1,17 +1,17 @@ /* * Sherlock Library -- URL Functions (according to RFC 1738 and 1808) * - * (c) 1997--1999 Martin Mares, + * (c) 1997--1999 Martin Mares */ +#include "lib/lib.h" +#include "lib/url.h" +#include "lib/chartype.h" + #include #include #include -#include "lib.h" -#include "url.h" -#include "string.h" - /* Escaping and de-escaping */ static uns @@ -302,7 +302,6 @@ copy: /* Combine part of old URL with the new one */ int url_normalize(struct url *u, struct url *b) { - byte *k; int err; /* Basic checks */ @@ -375,14 +374,14 @@ 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; } /* Pack a broken-down URL */ -byte * +static byte * append(byte *d, byte *s, byte *e) { if (d)