1 src/mime/mime.c change fixes crash on empty Content-Type (due to hash lookup
2 with empty ctype used as key)
3 src/viewer/text/form.c change adds Content-Type header to file uploads
4 (port from links-1.00pre8)
6 --- elinks-0.9.2/src/mime/mime.c.orig 2004-07-29 12:10:10.000000000 +0200
7 +++ elinks-0.9.2/src/mime/mime.c 2004-11-05 23:30:59.877593784 +0100
10 ctype = parse_http_header(head, "Content-Type", NULL);
12 + if (*ctype == '\0') {
13 + /* treat empty Content-Type as not present (to avoid crash) */
16 unsigned char *end = strchr(ctype, ';');
26 /* We can't use the extension string we are getting below, because we
27 --- elinks-0.9.2/src/viewer/text/form.c.orig 2004-01-08 04:44:01.000000000 +0100
28 +++ elinks-0.9.2/src/viewer/text/form.c 2004-11-06 00:28:36.941040256 +0100
32 unsigned char buffer[F_BUFLEN];
35 add_to_string(data, "\"; filename=\"");
36 add_to_string(data, strip_file_name(sv->value));
37 /* It sends bad data if the file name contains ", but
38 Netscape does the same */
39 /* FIXME: is this a reason ? --Zas */
40 - add_to_string(data, "\"\r\n\r\n");
41 + add_to_string(data, "\"");
42 + if ((ct = get_content_type(NULL, sv->value))) {
43 + add_to_string(data, "\r\nContent-Type: ");
44 + add_to_string(data, ct);
47 + add_to_string(data, "\r\n\r\n");
50 unsigned char *filename;