commit ee170927f0e1dbd59843c8144316bfeb958e572b
parent 95c109ec43d1874bda4c61ec8118f0f446fe583e
Author: htrb <htrb>
Date: Wed, 15 Dec 2010 10:50:24 +0000
[w3m-dev 04424] http://www.j10n.org/files/w3m-cvs-1.1040-misc.patch
Diffstat:
9 files changed, 67 insertions(+), 23 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,20 @@
+2010-12-15 AIDA Shinra <shinra@j10n.org>
+
+ * [w3m-dev 04424] Windows$BHG(Bw3mimg$B!"B>(B
+ * scripts/w3mman/Makefile.in (DESTDIR): removed.
+ * scripts/multipart/Makefile.in (DESTDIR): removed.
+ * scripts/Makefile.in (DESTDIR): removed.
+ * url.c (add_index_file): can specify multiple files as an index file for directories.
+ * mktable.c (defhashfunc): fi indent of output.
+ * ftp.c (ftp_login): support IPv6.
+ * file.c (is_text_type): check if the type is "application/xhtml".
+ * Makefile.in (DESTDIR): removed.
+ (GC_LIBS): added.
+ (EXT_LIBS): use "GC_LIBS".
+ (entity.h): depend on entity.tab and mktable$(EXT).
+ (indep.o): depend on entity.h
+ (mktable$(EXT)): depend on Str.o, hash.o and myctype.o instead of $(ALIB).
+
2010-12-15 Kazuhiko <kazuhiko@fdiary.net>
* [w3m-dev 04419] AC_W3M_EXTLIBS does not check /lib64
diff --git a/Makefile.in b/Makefile.in
@@ -27,7 +27,6 @@ sysconfdir = @sysconfdir@
top_srcdir = @top_srcdir@
top_builddir = .
VPATH = $(top_srcdir):.
-DESTDIR =
CGIBIN_DIR = $(libexecdir)/$(PACKAGE)/cgi-bin
AUXBIN_DIR = $(libexecdir)/$(PACKAGE)
@@ -46,7 +45,8 @@ DEFS = @DEFS@ -DAUXBIN_DIR=\"$(AUXBIN_DIR)\" \
-DLOCALEDIR=\"$(localedir)\"
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
-EXT_LIBS = -L. -lindep @LIBINTL@ @LIBGC@
+GC_LIBS = @LIBGC@
+EXT_LIBS = -L. -lindep @LIBINTL@ $(GC_LIBS)
W3M_LIBS = @W3M_LIBS@
WCTARGET = @WCTARGET@
NLSTARGET = @NLSTARGET@
@@ -136,7 +136,11 @@ $(OBJS) $(LOBJS): fm.h funcname1.h
tagtable.c: tagtable.tab mktable$(EXT) html.h
./mktable$(EXT) 100 $(srcdir)/tagtable.tab > $@
-indep.o: indep.c fm.h funcname1.h
+entity.h: entity.tab mktable$(EXT)
+ echo '/* $$I''d$$ */' > $@
+ ./mktable$(EXT) 100 $(srcdir)/entity.tab >> $@
+
+indep.o: indep.c fm.h funcname1.h entity.h
func.o: funcname.c functable.c funcname1.h
keybind.o: funcname2.h
keybind_lynx.o: funcname2.h
@@ -170,8 +174,8 @@ functable.c: funcname.tab mktable$(EXT)
./mktable$(EXT) 100 functable.tab > $@
-rm -f functable.tab
-mktable$(EXT): mktable.o dummy.o $(ALIB)
- $(CC) $(CFLAGS) -o mktable mktable.o dummy.o $(LDFLAGS) $(LIBS) $(EXT_LIBS)
+mktable$(EXT): mktable.o dummy.o Str.o hash.o myctype.o
+ $(CC) $(CFLAGS) -o mktable mktable.o dummy.o Str.o hash.o myctype.o $(LDFLAGS) $(LIBS) $(GC_LIBS)
$(BOOKMARKER): w3mbookmark.o dummy.o $(ALIB)
$(CC) $(CFLAGS) -o $(BOOKMARKER) w3mbookmark.o dummy.o $(LDFLAGS) $(LIBS) $(EXT_LIBS)
diff --git a/file.c b/file.c
@@ -262,6 +262,8 @@ is_text_type(char *type)
{
return (type == NULL || type[0] == '\0' ||
strncasecmp(type, "text/", 5) == 0 ||
+ (strncasecmp(type, "application/", 12) == 0 &&
+ strstr(type, "xhtml") != NULL) ||
strncasecmp(type, "message/", sizeof("message/") - 1) == 0);
}
diff --git a/ftp.c b/ftp.c
@@ -131,12 +131,30 @@ ftp_login(FTP ftp)
size_t n = strlen(ftp->pass);
if (n > 0 && ftp->pass[n - 1] == '@') {
+#ifdef INET6
+ struct sockaddr_storage sockname;
+#else
struct sockaddr_in sockname;
+#endif
socklen_t socknamelen = sizeof(sockname);
if (!getsockname(sock, (struct sockaddr *)&sockname, &socknamelen)) {
struct hostent *sockent;
Str tmp = Strnew_charp(ftp->pass);
+#ifdef INET6
+ char hostbuf[NI_MAXHOST];
+
+ if (getnameinfo((struct sockaddr *)&sockname, socknamelen,
+ hostbuf, sizeof hostbuf, NULL, 0, NI_NAMEREQD)
+ == 0)
+ Strcat_charp(tmp, hostbuf);
+ else if (getnameinfo((struct sockaddr *)&sockname, socknamelen,
+ hostbuf, sizeof hostbuf, NULL, 0, NI_NUMERICHOST)
+ == 0)
+ Strcat_m_charp(tmp, "[", hostbuf, "]", NULL);
+ else
+ Strcat_charp(tmp, "unknown");
+#else
if ((sockent = gethostbyaddr((char *)&sockname.sin_addr,
sizeof(sockname.sin_addr),
@@ -145,7 +163,7 @@ ftp_login(FTP ftp)
else
Strcat_m_charp(tmp, "[", inet_ntoa(sockname.sin_addr),
"]", NULL);
-
+#endif
ftp->pass = tmp->ptr;
}
}
diff --git a/mktable.c b/mktable.c
@@ -102,7 +102,7 @@ main(int argc, char *argv[], char **envp)
}
printf("static HashItem_si MyHashItem[] = {\n");
for (i = 0; i < j; i++) {
- printf(" /* %d */ {\"%s\",%s,", i,
+ printf(" /* %d */ {\"%s\", %s, ", i,
hashitems[i]->key, hashitems[i]->value);
if (hashitems[i]->next == NULL) {
printf("NULL},\n");
@@ -116,13 +116,13 @@ main(int argc, char *argv[], char **envp)
for (i = 0; i < hash->size; i++) {
if (hash->tab[i])
- printf(" &MyHashItem[%d],\n",
+ printf(" &MyHashItem[%d],\n",
getHash_hss_i(rhash, hash->tab[i], -1));
else
- printf(" NULL,\n");
+ printf(" NULL,\n");
}
printf("};\n\n");
- printf("Hash_si %s = {%d, MyHashItemTbl};\n", fbase->ptr, hash->size);
+ printf("Hash_si %s = { %d, MyHashItemTbl };\n", fbase->ptr, hash->size);
exit(0);
}
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
@@ -24,7 +24,6 @@ srcdir = @srcdir@
sysconfdir = @sysconfdir@
top_srcdir = @top_srcdir@
VPATH = $(srcdir):.
-DESTDIR =
CGIBIN_DIR = $(libexecdir)/$(PACKAGE)/cgi-bin
AUXBIN_DIR = $(libexecdir)/$(PACKAGE)
diff --git a/scripts/multipart/Makefile.in b/scripts/multipart/Makefile.in
@@ -24,7 +24,6 @@ srcdir = @srcdir@
sysconfdir = @sysconfdir@
top_srcdir = @top_srcdir@
VPATH = $(top_srcdir):.
-DESTDIR =
CGIBIN_DIR = $(libexecdir)/$(PACKAGE)/cgi-bin
AUXBIN_DIR = $(libexecdir)/$(PACKAGE)
diff --git a/scripts/w3mman/Makefile.in b/scripts/w3mman/Makefile.in
@@ -24,7 +24,6 @@ srcdir = @srcdir@
sysconfdir = @sysconfdir@
top_srcdir = @top_srcdir@
VPATH = $(top_srcdir):.
-DESTDIR =
CGIBIN_DIR = $(libexecdir)/$(PACKAGE)/cgi-bin
AUXBIN_DIR = $(libexecdir)/$(PACKAGE)
diff --git a/url.c b/url.c
@@ -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 *