X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Furl.c;h=3f4b89920fd2f5d2b37956f3c6f05ba0086051af;hp=5d9cd91f51d90ec0957aba9561a76ae273f8f11d;hb=dc9abe478f8175d342f190993d0dc61891a7da8e;hpb=90a2d106cd5ed579cf86136cb34814427b3f33a3 diff --git a/src/url.c b/src/url.c index 5d9cd91f..3f4b8992 100644 --- a/src/url.c +++ b/src/url.c @@ -1448,11 +1448,17 @@ url_file_name (const struct url *u) const char *u_file, *u_query; char *fname, *unique; + char *index_filename = "index.html"; /* The default index file is index.html */ fnres.base = NULL; fnres.size = 0; fnres.tail = 0; + /* If an alternative index file was defined, change index_filename */ + if (opt.default_page) + index_filename = opt.default_page; + + /* Start with the directory prefix, if specified. */ if (opt.dir_prefix) append_string (opt.dir_prefix, &fnres); @@ -1494,7 +1500,7 @@ url_file_name (const struct url *u) /* Add the file name. */ if (fnres.tail) append_char ('/', &fnres); - u_file = *u->file ? u->file : "index.html"; + u_file = *u->file ? u->file : index_filename; append_uri_pathel (u_file, u_file + strlen (u_file), false, &fnres); /* Append "?query" to the file name. */