From b9f370004d74d3bed7c41d26868124d0ca2e9fad Mon Sep 17 00:00:00 2001 From: hniksic Date: Wed, 12 Dec 2001 11:06:10 -0800 Subject: [PATCH] [svn] Cosmetic changes to get_urls_html. --- src/ChangeLog | 4 ++++ src/url.c | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 638e05ab..c172dbd1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2001-12-12 Hrvoje Niksic + + * url.c (get_urls_file): Cosmetic changes. + 2001-12-12 Hrvoje Niksic * html-url.c (append_one_url): Resurrect warning when unable to diff --git a/src/url.c b/src/url.c index f2953c40..37d95c89 100644 --- 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. */ -- 2.39.2