]> sjero.net Git - wget/commitdiff
[svn] Minor -Wall-induced fixes. Also, skip_url is removed.
authorhniksic <devnull@localhost>
Fri, 13 Apr 2001 03:39:23 +0000 (20:39 -0700)
committerhniksic <devnull@localhost>
Fri, 13 Apr 2001 03:39:23 +0000 (20:39 -0700)
Published in <sxs8zl5v5cw.fsf@florida.arsdigita.de>.

src/ChangeLog
src/cookies.c
src/cookies.h
src/ftp-ls.c
src/host.c
src/init.c
src/url.c
src/url.h

index 862c43ecb75d5af0608ecde80a744c98d0316176..98b34b6344e69250b3dcf0ae17c1ec7d9781fc06 100644 (file)
@@ -1,3 +1,17 @@
+2001-04-13  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * init.c: Include cookies.h.
+
+       * cookies.h: Declare cookies_cleanup.
+
+       * cookies.c (check_domain_match): Remove unused variable.
+       (save_cookies): Remove extraneous argument from debug statement.
+
+       * host.c (same_host): Don't call skip_url.
+
+       * url.c (skip_url): Removed.  Removed its calls from various
+       functions in url.c.
+
 2001-04-13  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * cookies.c (unsigned_string_hash): Use the new code in
index 65ee3f1cddd13249cd425a078366f82df132cff2..f915d820fbc4c992c8b9877579aedc91f670fc89 100644 (file)
@@ -703,7 +703,7 @@ numeric_address_p (const char *addr)
 static int
 check_domain_match (const char *cookie_domain, const char *host)
 {
-  int i, headlen;
+  int headlen;
   const char *tail;
 
   /* Numeric address requires exact match.  It also requires HOST to
@@ -1370,7 +1370,7 @@ save_cookies (const char *file)
     logprintf (LOG_NOTQUIET, _("Error closing `%s': %s\n"),
               file, strerror (errno));
 
-  DEBUGP (("Done saving cookies.\n", file));
+  DEBUGP (("Done saving cookies.\n"));
 }
 \f
 static int
index 986dcf798a1cc0d7485375280eaf1685237d9d88..19d762cfb4e2a42f7b00337061137d194349ca14 100644 (file)
@@ -26,3 +26,5 @@ char *build_cookies_request PARAMS ((const char *, int, const char *, int));
 
 void load_cookies PARAMS ((const char *));
 void save_cookies PARAMS ((const char *));
+
+void cookies_cleanup PARAMS ((void));
index bd3309c62004608553fb65b947ff407a898fae92..b36221890674f6168ccbee63b984d218c97b9640 100644 (file)
@@ -564,7 +564,7 @@ ftp_parse_vms_ls (const char *file)
   int hour, min, sec;
   struct tm timestruct;
 
-  char *line, *tok, *p;          /* tokenizer */
+  char *line, *tok;             /* tokenizer */
   struct fileinfo *dir, *l, cur; /* list creation */
 
   fp = fopen (file, "rb");
index 148ba036cec31d0e98e982b21ce99909baf7b5bc..9cfb21f9e06e49cb372e1faa5bcddea0f1c7ee42 100644 (file)
@@ -272,8 +272,6 @@ same_host (const char *u1, const char *u2)
   char *real1, *real2;
 
   /* Skip protocol, if present.  */
-  u1 += skip_url (u1);
-  u2 += skip_url (u2);
   u1 += skip_proto (u1);
   u2 += skip_proto (u2);
 
index 459f43edeb910986fbf5503a451640e748c7a9de..46fd6b910621be0532e6181d38eec567c0dafe61 100644 (file)
@@ -50,6 +50,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "host.h"
 #include "recur.h"
 #include "netrc.h"
+#include "cookies.h"           /* for cookies_cleanup */
 
 #ifndef errno
 extern int errno;
index cca3ac96568a1d919a58aaafdd73a898f8179412..9b110e6eec86bffff3fb29b5218984f46cd3654c 100644 (file)
--- a/src/url.c
+++ b/src/url.c
@@ -71,9 +71,9 @@ static void path_simplify_with_kludge PARAMS ((char *));
 #endif
 static int urlpath_length PARAMS ((const char *));
 
-/* NULL-terminated list of strings to be recognized as prototypes (URL
-   schemes).  Note that recognized doesn't mean supported -- only HTTP,
-   HTTPS and FTP are currently supported .
+/* A NULL-terminated list of strings to be recognized as prototypes
+   (URL schemes).  Note that recognized doesn't mean supported -- only
+   HTTP, HTTPS and FTP are currently supported .
 
    However, a string that does not match anything in the list will be
    considered a relative URL.  Thus it's important that this list has
@@ -131,8 +131,7 @@ static struct proto sup_protos[] =
 #ifdef HAVE_SSL
   { "https://",URLHTTPS, DEFAULT_HTTPS_PORT},
 #endif
-  { "ftp://", URLFTP, DEFAULT_FTP_PORT },
-  /*{ "file://", URLFILE, DEFAULT_FTP_PORT },*/
+  { "ftp://", URLFTP, DEFAULT_FTP_PORT }
 };
 
 static void parse_dir PARAMS ((const char *, char **, char **));
@@ -142,27 +141,6 @@ static char *construct_relative PARAMS ((const char *, const char *));
 static char process_ftp_type PARAMS ((char *));
 
 \f
-/* Returns the number of characters to be skipped if the first thing
-   in a URL is URL: (which is 0 or 4+).  The optional spaces after
-   URL: are also skipped.  */
-int
-skip_url (const char *url)
-{
-  int i;
-
-  if (TOUPPER (url[0]) == 'U'
-      && TOUPPER (url[1]) == 'R'
-      && TOUPPER (url[2]) == 'L'
-      && url[3] == ':')
-    {
-      /* Skip blanks.  */
-      for (i = 4; url[i] && ISSPACE (url[i]); i++);
-      return i;
-    }
-  else
-    return 0;
-}
-
 /* Unsafe chars:
    - anything <= 32;
    - stuff from rfc1738 ("<>\"#%{}|\\^~[]`");
@@ -270,7 +248,6 @@ urlproto (const char *url)
 {
   int i;
 
-  url += skip_url (url);
   for (i = 0; i < ARRAY_SIZE (sup_protos); i++)
     if (!strncasecmp (url, sup_protos[i].name, strlen (sup_protos[i].name)))
       return sup_protos[i].ind;
@@ -317,7 +294,6 @@ has_proto (const char *url)
 {
   char **s;
 
-  url += skip_url (url);
   for (s = protostrings; *s; s++)
     if (strncasecmp (url, *s, strlen (*s)) == 0)
       return 1;
@@ -409,7 +385,6 @@ parseurl (const char *url, struct urlinfo *u, int strict)
   uerr_t type;
 
   DEBUGP (("parseurl (\"%s\") -> ", url));
-  url += skip_url (url);
   recognizable = has_proto (url);
   if (strict && !recognizable)
     return URLUNKNOWN;
@@ -607,8 +582,8 @@ parse_uname (const char *url, char **user, char **passwd)
 
   *user = NULL;
   *passwd = NULL;
-  url += skip_url (url);
-  /* Look for end of protocol string.  */
+
+  /* Look for the end of the protocol string.  */
   l = skip_proto (url);
   if (!l)
     return URLUNKNOWN;
index e53cf2d764d2a026d3095d529c7b04b79c685262..bc06fe45d049c941bf5d14e1b1dddf354099e0ab 100644 (file)
--- a/src/url.h
+++ b/src/url.h
@@ -97,8 +97,6 @@ typedef enum
 
 /* Function declarations */
 
-int skip_url PARAMS ((const char *));
-
 int contains_unsafe PARAMS ((const char *));
 char *encode_string PARAMS ((const char *));