]> sjero.net Git - wget/blobdiff - src/html-url.c
Minor tweaks to Henri's patch.
[wget] / src / html-url.c
index 97443ea0e20cc9ac7f86bf9007ab173da8cb57c2..0eb6650683da42431ddb968944c36b7f6086cef7 100644 (file)
@@ -1,6 +1,6 @@
 /* Collect URLs from HTML source.
    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-   2007 Free Software Foundation, Inc.
+   2007, 2008 Free Software Foundation, Inc.
 
 This file is part of GNU Wget.
 
@@ -17,17 +17,18 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with Wget.  If not, see <http://www.gnu.org/licenses/>.
 
-In addition, as a special exception, the Free Software Foundation
-gives permission to link the code of its release of Wget with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.  */
+Additional permission under GNU GPL version 3 section 7
 
-#include <config.h>
+If you modify this program, or any covered work, by linking or
+combining it with the OpenSSL project's OpenSSL library (or a
+modified version of that library), containing parts covered by the
+terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+grants you additional permission to convey the resulting work.
+Corresponding Source for a non-source form of such a combination
+shall include the source code for the parts of OpenSSL used as well
+as that of the covered work.  */
+
+#include "wget.h"
 
 #include <stdio.h>
 #include <string.h>
@@ -35,7 +36,6 @@ so, delete this exception statement from your version.  */
 #include <errno.h>
 #include <assert.h>
 
-#include "wget.h"
 #include "html-parse.h"
 #include "url.h"
 #include "utils.h"
@@ -185,7 +185,7 @@ init_interesting (void)
      matches the user's preferences as specified through --ignore-tags
      and --follow-tags.  */
 
-  int i;
+  size_t i;
   interesting_tags = make_nocase_string_hash_table (countof (known_tags));
 
   /* First, add all the tags we know hot to handle, mapped to their
@@ -355,7 +355,8 @@ append_url (const char *link_uri,
 static void
 tag_find_urls (int tagid, struct taginfo *tag, struct map_context *ctx)
 {
-  int i, attrind;
+  size_t i;
+  int attrind;
   int first = -1;
 
   for (i = 0; i < countof (tag_url_attributes); i++)
@@ -382,7 +383,7 @@ tag_find_urls (int tagid, struct taginfo *tag, struct map_context *ctx)
       /* Find whether TAG/ATTRIND is a combination that contains a
          URL. */
       char *link = tag->attrs[attrind].value;
-      const int size = countof (tag_url_attributes);
+      const size_t size = countof (tag_url_attributes);
 
       /* If you're cringing at the inefficiency of the nested loops,
          remember that they both iterate over a very small number of
@@ -509,20 +510,20 @@ tag_handle_meta (int tagid, struct taginfo *tag, struct map_context *ctx)
       if (!refresh)
         return;
 
-      for (p = refresh; ISDIGIT (*p); p++)
+      for (p = refresh; c_isdigit (*p); p++)
         timeout = 10 * timeout + *p - '0';
       if (*p++ != ';')
         return;
 
-      while (ISSPACE (*p))
+      while (c_isspace (*p))
         ++p;
-      if (!(   TOUPPER (*p)       == 'U'
-            && TOUPPER (*(p + 1)) == 'R'
-            && TOUPPER (*(p + 2)) == 'L'
+      if (!(   c_toupper (*p)       == 'U'
+            && c_toupper (*(p + 1)) == 'R'
+            && c_toupper (*(p + 2)) == 'L'
             &&          *(p + 3)  == '='))
         return;
       p += 4;
-      while (ISSPACE (*p))
+      while (c_isspace (*p))
         ++p;
 
       entry = append_url (p, tag, attrind, ctx);
@@ -668,9 +669,9 @@ get_urls_file (const char *file)
       text = line_end;
 
       /* Strip whitespace from the beginning and end of line. */
-      while (line_beg < line_end && ISSPACE (*line_beg))
+      while (line_beg < line_end && c_isspace (*line_beg))
         ++line_beg;
-      while (line_end > line_beg && ISSPACE (*(line_end - 1)))
+      while (line_end > line_beg && c_isspace (*(line_end - 1)))
         --line_end;
 
       if (line_beg == line_end)