]> sjero.net Git - wget/commitdiff
[svn] Cosmetic changes to get_urls_html.
authorhniksic <devnull@localhost>
Wed, 12 Dec 2001 19:06:10 +0000 (11:06 -0800)
committerhniksic <devnull@localhost>
Wed, 12 Dec 2001 19:06:10 +0000 (11:06 -0800)
src/ChangeLog
src/url.c

index 638e05ab4f776586eef2f0785f20e0146147418f..c172dbd1398061de52f53e35d227f37b6a7adf37 100644 (file)
@@ -1,3 +1,7 @@
+2001-12-12  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * url.c (get_urls_file): Cosmetic changes.
+
 2001-12-12  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * html-url.c (append_one_url): Resurrect warning when unable to
index f2953c40c778aefa35e18323014e383eae9c5e47..37d95c8958230123bcd5e9e50d5eb2248783f126 100644 (file)
--- a/src/url.c
+++ b/src/url.c
@@ -998,6 +998,7 @@ get_urls_file (const char *file)
       return NULL;
     }
   DEBUGP (("Loaded %s (size %ld).\n", file, fm->length));
+
   head = tail = NULL;
   text = fm->content;
   text_end = fm->content + fm->length;
@@ -1010,12 +1011,13 @@ get_urls_file (const char *file)
       else
        ++line_end;
       text = line_end;
-      while (line_beg < line_end
-            && ISSPACE (*line_beg))
+
+      /* Strip whitespace from the beginning and end of line. */
+      while (line_beg < line_end && ISSPACE (*line_beg))
        ++line_beg;
-      while (line_end > line_beg + 1
-            && ISSPACE (*(line_end - 1)))
+      while (line_end > line_beg && ISSPACE (*(line_end - 1)))
        --line_end;
+
       if (line_end > line_beg)
        {
          /* URL is in the [line_beg, line_end) region. */