-src/mime/mime.c change fixes crash on empty Content-Type (due to hash lookup
-with empty ctype used as key)
-src/viewer/text/form.c change adds Content-Type header to file uploads
-(port from links-1.00pre8)
-
---- elinks-0.9.2/src/mime/mime.c.orig 2004-07-29 12:10:10.000000000 +0200
-+++ elinks-0.9.2/src/mime/mime.c 2004-11-05 23:30:59.877593784 +0100
-@@ -126,6 +126,10 @@
- if (head) {
- ctype = parse_http_header(head, "Content-Type", NULL);
- if (ctype) {
-+ if (*ctype == '\0') {
-+ /* treat empty Content-Type as not present (to avoid crash) */
-+ mem_free(ctype);
-+ } else {
- unsigned char *end = strchr(ctype, ';');
- int ctypelen;
+--- elinks-0.10.0/src/mime/mime.c.orig 2004-10-14 20:50:37.000000000 +0200
++++ elinks-0.10.0/src/mime/mime.c 2004-12-31 13:26:02.000000000 +0100
+@@ -177,6 +177,8 @@
-@@ -139,6 +143,7 @@
+ ctype = parse_header(cached->head, "Content-Type", NULL);
+ if (ctype) {
++ /* treat empty Content-Type as not present (to avoid crash) */
++ if (*ctype != '\0') {
+ unsigned char *end = strchr(ctype, ';');
+ int ctypelen;
+@@ -191,7 +193,7 @@
+ if (*ctype) {
return ctype;
}
-+ }
+-
++ }
+ mem_free(ctype);
}
- /* We can't use the extension string we are getting below, because we
---- elinks-0.9.2/src/viewer/text/form.c.orig 2004-01-08 04:44:01.000000000 +0100
-+++ elinks-0.9.2/src/viewer/text/form.c 2004-11-06 00:28:36.941040256 +0100
-@@ -562,13 +562,20 @@
- #define F_BUFLEN 1024
- int fh, rd;
- unsigned char buffer[F_BUFLEN];
-+ unsigned char *ct;
-
- add_to_string(data, "\"; filename=\"");
- add_to_string(data, strip_file_name(sv->value));
- /* It sends bad data if the file name contains ", but
- Netscape does the same */
- /* FIXME: is this a reason ? --Zas */
-- add_to_string(data, "\"\r\n\r\n");
-+ add_to_string(data, "\"");
-+ if ((ct = get_content_type(NULL, sv->value))) {
-+ add_to_string(data, "\r\nContent-Type: ");
-+ add_to_string(data, ct);
-+ mem_free(ct);
-+ }
-+ add_to_string(data, "\r\n\r\n");
-
- if (*sv->value) {
- unsigned char *filename;
-- Convert bm.lua-format bookmarks to ELinks-format bookmarks.
-- Peter Wang, 2002-12-19
-diff -ruN elinks-0.9.1./contrib/lua/lua/bm-to-elinks-bookmarks.lua elinks-0.9.1/contrib/lua/lua/bm-to-elinks-bookmarks.lua
---- elinks-0.9.1./contrib/lua/lua/bm-to-elinks-bookmarks.lua 2002-12-20 22:58:30.000000000 +0100
-+++ elinks-0.9.1/contrib/lua/lua/bm-to-elinks-bookmarks.lua 2004-03-28 19:37:19.185988504 +0200
-@@ -1,4 +1,4 @@
--#!/usr/bin/lua -f
-+#!/usr/bin/lua40 -f
- -- Convert bm.lua-format bookmarks to ELinks-format bookmarks.
- -- Peter Wang, 2002-12-19
-