]> mj.ucw.cz Git - libucw.git/blobdiff - lib/url.c
Added ABS macro.
[libucw.git] / lib / url.c
index 9b031694ef09613f7ca36327399c3dc6475cbb45..ac7fd8b7e6ede31514564628c6537d9fea38a51a 100644 (file)
--- 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, <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
@@ -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)