+2008-08-01 Joao Ferreira <joao@joaoff.com>
+
+ * NEWS: Added option --default-page to support alternative
+ default names for index.html
+
2008-06-30 Micah Cowan <micah@cowan.name>
* NEWS: Entries for 1.11.4.
\f
* Changes in Wget 1.12 (MAINLINE)
+** --default-page option added to support alternative default names for
+index.html.
+
** Added support for CSS. This includes:
- Parsing links from CSS files, and from CSS content found in HTML
style tags and attributes.
+2008-08-01 Joao Ferreira <joao@joaoff.com>
+
+ * init.c, main.c, options.h, url.c: Added option --default-page
+ to support alternative default names for index.html
+
2008-08-03 Micah Cowan <micah@cowan.name>
* build_info.c, css-url.c: #include wget.h, not config.h.
#ifdef ENABLE_DEBUG
{ "debug", &opt.debug, cmd_boolean },
#endif
+ { "defaultpage", &opt.default_page, cmd_string},
{ "deleteafter", &opt.delete_after, cmd_boolean },
{ "dirprefix", &opt.dir_prefix, cmd_directory },
{ "dirstruct", NULL, cmd_spec_dirstruct },
{ "cookies", 0, OPT_BOOLEAN, "cookies", -1 },
{ "cut-dirs", 0, OPT_VALUE, "cutdirs", -1 },
{ WHEN_DEBUG ("debug"), 'd', OPT_BOOLEAN, "debug", -1 },
+ { "default-page", 0, OPT_VALUE, "defaultpage", -1 },
{ "delete-after", 0, OPT_BOOLEAN, "deleteafter", -1 },
{ "directories", 0, OPT_BOOLEAN, "dirstruct", -1 },
{ "directory-prefix", 'P', OPT_VALUE, "dirprefix", -1 },
char *input_filename; /* Input filename */
bool force_html; /* Is the input file an HTML file? */
+ char *default_page; /* Alternative default page (index file) */
+
bool spider; /* Is Wget in spider mode? */
char **accepts; /* List of patterns to accept. */
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);
/* 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. */