From 7c039a46d5faf90e26408e073cedca510efc1eac Mon Sep 17 00:00:00 2001 From: Ito Hiroyuki Date: Wed, 15 Dec 2010 10:50:24 +0000 Subject: [w3m-dev 04424] http://www.j10n.org/files/w3m-cvs-1.1040-misc.patch --- url.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'url.c') diff --git a/url.c b/url.c index ac82082..ed6062e 100644 --- a/url.c +++ b/url.c @@ -1,4 +1,4 @@ -/* $Id: url.c,v 1.99 2010/12/11 13:00:11 htrb Exp $ */ +/* $Id: url.c,v 1.100 2010/12/15 10:50:24 htrb Exp $ */ #include "fm.h" #ifndef __MINGW32_VERSION #include @@ -1814,20 +1814,26 @@ static void add_index_file(ParsedURL *pu, URLFile *uf) { char *p, *q; + TextList *index_file_list = NULL; + TextListItem *ti; - if (index_file == NULL || index_file[0] == '\0') { + if (non_null(index_file)) + index_file_list = make_domain_list(index_file); + if (index_file_list == NULL) { uf->stream = NULL; return; } - p = Strnew_m_charp(pu->file, "/", file_quote(index_file), NULL)->ptr; - p = cleanupName(p); - q = cleanupName(file_unquote(p)); - examineFile(q, uf); - if (uf->stream == NULL) - return; - pu->file = p; - pu->real_file = q; - return; + for (ti = index_file_list->first; ti; ti = ti->next) { + p = Strnew_m_charp(pu->file, "/", file_quote(ti->ptr), NULL)->ptr; + p = cleanupName(p); + q = cleanupName(file_unquote(p)); + examineFile(q, uf); + if (uf->stream != NULL) { + pu->file = p; + pu->real_file = q; + return; + } + } } static char * -- cgit v1.2.3