]> sjero.net Git - wget/commitdiff
[svn] Minor fixes prompted by `lint'.
authorhniksic <devnull@localhost>
Sun, 9 Dec 2001 01:24:41 +0000 (17:24 -0800)
committerhniksic <devnull@localhost>
Sun, 9 Dec 2001 01:24:41 +0000 (17:24 -0800)
Published in <sxsadwt2nkg.fsf@florida.arsdigita.de>.

src/ChangeLog
src/cookies.c
src/ftp-ls.c
src/host.c
src/html-url.c
src/http.c
src/log.c
src/progress.c
src/res.c
src/url.c
src/utils.c

index b5780ba177b6de3451082de2a8434e1de307f53d..bc0a1a4639b056d3e42201be3316492b2a10651b 100644 (file)
@@ -1,3 +1,32 @@
+2001-12-09  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * url.c (reencode_string): Declare static.
+
+       * res.c (registered_specs): Declare static.
+
+       * progress.c (current_impl_locked): Declare static.
+
+       * log.c (flush_log_p): Declare static.
+       (needs_flushing): Ditto.
+
+       * http.c (digest_authentication_encode): Declare static.
+
+       * html-url.c (init_interesting): Declare static.
+
+       * host.c (host_name_addresses_map): Declare static.
+
+       * cookies.c (find_matching_chains): Declare static.
+
+       * ftp-ls.c (ftp_parse_vms_ls): Warn about the memory leak
+       indicated by lint.
+
+       * utils.c (path_simplify): Remove unused variable STUB_CHAR.
+
+       * host.c (address_list_set_faulty): Document that INDEX is
+       currently unused.
+
+       * url.c (rewrite_shorthand_url): Remove unused variable PATH.
+
 2001-12-08  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * version.c: Wget 1.8-pre2 is released.
index f1458594efdaa82f8b72c1c7cdc78c21b62e9bc8..b4559600a2893c6b2dd0880d69d254390e6fab1b 100644 (file)
@@ -825,7 +825,7 @@ set_cookie_header_cb (const char *hdr, void *closure)
    SIZE matches are written; if more matches are present, return the
    number of chains that would have been written.  */
 
-int
+static int
 find_matching_chains (const char *host, int port,
                      struct cookie *store[], int size)
 {
index 91c572e7018a9d3e138e6ebf2ae9bf6d2638c3e3..4279c4944a1463b4197b4709825c890f71f149c0 100644 (file)
@@ -577,6 +577,10 @@ ftp_parse_vms_ls (const char *file)
     }
   dir = l = NULL;
 
+  /* #### The next three lines are a memory leak because they don't
+     bother to free the pointer that read_whole_line() returns!
+     FIXME! */
+
   /* Empty line */
   read_whole_line (fp);
   /* "Directory PUB$DEVICE[PUB]" */
index 9fecb5d4081daf8fd48762d7f5ea157aba136bd4..e27383d6f44867ccf8c268fdd2456805579703c5 100644 (file)
@@ -69,7 +69,7 @@ extern int h_errno;
 
 /* Mapping between known hosts and to lists of their addresses. */
 
-struct hash_table *host_name_addresses_map;
+static struct hash_table *host_name_addresses_map;
 \f
 /* Lists of addresses.  This should eventually be extended to handle
    IPv6.  */
@@ -124,6 +124,13 @@ address_list_match_all (struct address_list *al1, struct address_list *al2)
 void
 address_list_set_faulty (struct address_list *al, int index)
 {
+#if 0
+  /* Warning: INDEX is unused, so this assumes that the address list
+     is traversed in order.  In the next release, either enable this
+     assert, or use INDEX.  */
+  assert (index == al->faulty);
+#endif
+
   ++al->faulty;
   if (al->faulty >= al->count)
     /* All addresses have been proven faulty.  Since there's not much
index cac61ae3af0ad6b26a37b64ad14f7a5ee2df1e41..12d4334d4c04ce6af7a78d16facb81e8325d3aa9 100644 (file)
@@ -140,7 +140,7 @@ static const char *additional_attributes[] = {
 static const char **interesting_tags;
 static const char **interesting_attributes;
 
-void
+static void
 init_interesting (void)
 {
   /* Init the variables interesting_tags and interesting_attributes
index 16f5dc2da082a920f2a94b6386203456146d5824..95bb31eacccbea7d7ab8b0ad987382471330c124 100644 (file)
@@ -2164,7 +2164,7 @@ dump_hash (unsigned char *buf, const unsigned char *hash)
 
 /* Take the line apart to find the challenge, and compose a digest
    authorization header.  See RFC2069 section 2.1.2.  */
-char *
+static char *
 digest_authentication_encode (const char *au, const char *user,
                              const char *passwd, const char *method,
                              const char *path)
index a8ecebd4311b1d39f8f1bce4620f7e50cabb593f..f79c5eb4122e646e7e5259003aaae0a80697f2bf 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -53,8 +53,8 @@ static FILE *logfp;
 int save_log_p;
 
 /* Whether the log is flushed after each command. */
-int flush_log_p = 1;
-int needs_flushing;
+static int flush_log_p = 1;
+static int needs_flushing;
 
 /* In the event of a hang-up, and if its output was on a TTY, Wget
    redirects its output to `wget-log'.
index 9b42c47bdb71fc80cbdd73170c342795ac47e8b6..c4dd737e6d269df90baaef1ed951aee777663917 100644 (file)
@@ -64,7 +64,7 @@ static struct progress_implementation implementations[] = {
   { "bar", bar_create, bar_update, bar_finish, bar_set_params }
 };
 static struct progress_implementation *current_impl;
-int current_impl_locked;
+static int current_impl_locked;
 
 /* Progress implementation used by default.  Can be overriden in
    wgetrc or by the fallback one.  */
index 32b53b1beadaeebb33d4cb10ac8ed9a730e49743..c2f383c2a38a818fa6c571e6e8ca07e534e2063c 100644 (file)
--- a/src/res.c
+++ b/src/res.c
@@ -470,7 +470,7 @@ res_match_path (const struct robot_specs *specs, const char *path)
 \f
 /* Registering the specs. */
 
-struct hash_table *registered_specs;
+static struct hash_table *registered_specs;
 
 /* Stolen from cookies.c. */
 #define SET_HOSTPORT(host, port, result) do {          \
index 5be58fcbdacabe00f6b8e86db78c87b0bcb4993b..ecf94417574d71ecfb99cacb1fc915488030a78e 100644 (file)
--- a/src/url.c
+++ b/src/url.c
@@ -334,7 +334,7 @@ decide_copy_method (const char *p)
    "foo+bar"         -> "foo+bar"            (plus is reserved!)
    "foo%2b+bar"      -> "foo%2b+bar"  */
 
-char *
+static char *
 reencode_string (const char *s)
 {
   const char *p1;
@@ -559,19 +559,17 @@ rewrite_shorthand_url (const char *url)
 
   if (*p == ':')
     {
-      const char *pp, *path;
+      const char *pp;
       char *res;
       /* If the characters after the colon and before the next slash
         or end of string are all digits, it's HTTP.  */
       int digits = 0;
       for (pp = p + 1; ISDIGIT (*pp); pp++)
        ++digits;
-      if (digits > 0
-         && (*pp == '/' || *pp == '\0'))
+      if (digits > 0 && (*pp == '/' || *pp == '\0'))
        goto http;
 
       /* Prepend "ftp://" to the entire URL... */
-      path = p + 1;
       res = xmalloc (6 + strlen (url) + 1);
       sprintf (res, "ftp://%s", url);
       /* ...and replace ':' with '/'. */
index 60d8bb9f8fd945231f5a5d4a6a068205a3bab046..32c17b4bfd9026e4b8fb8240c62bb580edf0cfc4 100644 (file)
@@ -512,13 +512,10 @@ path_simplify (char *path)
 {
   register int i, start;
   int changes = 0;
-  char stub_char;
 
   if (!*path)
     return 0;
 
-  stub_char = '/';
-
   if (path[0] == '/')
     /* Preserve initial '/'. */
     ++path;