X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fres.c;h=3038229bf074891e3dcdee5c383aeef77d264df3;hp=edb12bd6d2b13824ff37031e8effb0ce11974170;hb=HEAD;hpb=1f883393c823632cc14c2837bd879bbcfaba2103 diff --git a/src/res.c b/src/res.c index edb12bd6..3038229b 100644 --- a/src/res.c +++ b/src/res.c @@ -552,7 +552,7 @@ res_retrieve_file (const char *url, char **file, struct iri *iri) opt.timestamping = false; opt.spider = false; - url_parsed = url_parse (robots_url, &url_err, iri, true); + url_parsed = url_parse (robots_url, &url_err, i, true); if (!url_parsed) { char *error = url_error (robots_url, url_err); @@ -615,11 +615,11 @@ res_cleanup (void) #ifdef TESTING const char * -test_is_robots_txt_url() +test_is_robots_txt_url(void) { - int i; - struct { - char *url; + unsigned i; + static const struct { + const char *url; bool expected_result; } test_array[] = { { "http://www.yoyodyne.com/robots.txt", true }, @@ -627,7 +627,7 @@ test_is_robots_txt_url() { "http://www.yoyodyne.com/somepath/robots.txt", false }, }; - for (i = 0; i < sizeof(test_array)/sizeof(test_array[0]); ++i) + for (i = 0; i < countof(test_array); ++i) { mu_assert ("test_is_robots_txt_url: wrong result", is_robots_txt_url (test_array[i].url) == test_array[i].expected_result);