RETRUNNEEDED appears never to be referenced outside of
http.c (and wget.h), and, when returned by gethttp, is
translated by http_loop to RETROK.
+ * url.c (are_urls_equal): Don't call getchar_from_escaped_string
+ if u2 is shorter than u1.
+ (test_are_urls_equal): Added tests to handle u2 shorter than u1,
+ and %2f not treated the same as / (latter currently fails).
+ * spider.c (in_url_list_p): Don't call are_urls_equal if one of
+ them is NULL.
2007-08-23 Joshua David Williams <yurimxpxman@gmail.com>
for (ptr = list; ptr; ptr = ptr->next)
{
/* str[case]cmp is inadequate for URL comparison */
- if (are_urls_equal (url, ptr->url))
+ if (ptr->url != NULL && are_urls_equal (url, ptr->url))
return true;
}
const char *p, *q;
int pp, qq;
char ch1, ch2;
+ assert(u1 && u2);
p = u1;
q = u2;
- while (*p
+ while (*p && *q
&& (pp = getchar_from_escaped_string (p, &ch1))
&& (qq = getchar_from_escaped_string (q, &ch2))
&& (TOLOWER(ch1) == TOLOWER(ch2)))
{ "http://www.adomain.com/apath/", "http://www.adomain.com/anotherpath/", false },
{ "http://www.adomain.com/apath/", "http://www.anotherdomain.com/path/", false },
{ "http://www.adomain.com/~path/", "http://www.adomain.com/%7epath/", true },
+ { "http://www.adomain.com/longer-path/", "http://www.adomain.com/path/", false },
+ { "http://www.adomain.com/path%2f", "http://www.adomain.com/path/", false },
};
for (i = 0; i < sizeof(test_array)/sizeof(test_array[0]); ++i)