/*
* Sherlock Library -- URL Functions (according to RFC 1738 and 1808)
*
- * (c) 1997--1999 Martin Mares, <mj@atrey.karlin.mff.cuni.cz>
+ * (c) 1997--1999 Martin Mares <mj@ucw.cz>
*/
+#include "lib/lib.h"
+#include "lib/url.h"
+#include "lib/chartype.h"
+
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
-#include "lib.h"
-#include "url.h"
-#include "string.h"
-
/* Escaping and de-escaping */
static uns
int
url_normalize(struct url *u, struct url *b)
{
- byte *k;
int err;
/* Basic checks */
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)