aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2003-01-08 17:24:11 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2003-01-08 17:24:11 +0000
commite78b061cfd01caee387b63c6af2bc5f1f9cb9585 (patch)
tree1d1030814ed785daef2e93b51df64e2372b733f2 /file.c
parentupdate TODO (diff)
downloadw3m-e78b061cfd01caee387b63c6af2bc5f1f9cb9585.tar.gz
w3m-e78b061cfd01caee387b63c6af2bc5f1f9cb9585.zip
[w3m-dev 03616] Re: data: URL scheme
* file.c (loadGeneralFile): check SCM_DATA (loadImageBuffer): newBuffer() * html.h (SCM_DATA): added * indep.c (url_unquote): deleted (Str_url_unquote): renamed from Str_form_unquote + is decoded is_form only * indep.h (url_unquote): deleted (Str_url_unquote): added (Str_form_unquote): define by Str_url_unquote * main.c (followA): file_unquote (cmd_loadURL): file_unquote * url.c (DefaultPort): add for data: (schemetable): add "data" (DefaultFile): SCM_FTPDIR (parseURL): scheme copied from current (parseURL2): SCM_DATA check SCM_FTP, SCM_FTPDIR (_parsedURL2Str): add data in scheme_str handle SCM_DATA SCM_FTPDIR (openURL): file_unquote handle SCM_DATA From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r--file.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/file.c b/file.c
index 876f35e..4345057 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.175 2003/01/06 15:36:58 ukai Exp $ */
+/* $Id: file.c,v 1.176 2003/01/08 17:24:12 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -1870,6 +1870,9 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
}
#endif
}
+ else if (pu.scheme == SCM_DATA) {
+ t = f.guess_type;
+ }
else if (searchHeader) {
t_buf = newBuffer(INIT_BUFFER_WIDTH);
readHeader(&f, t_buf, searchHeader_through, &pu);
@@ -6867,13 +6870,13 @@ loadImageBuffer(URLFile *uf, Buffer *newBuf)
cache->index = 0;
image_buffer:
+ if (newBuf == NULL)
+ newBuf = newBuffer(INIT_BUFFER_WIDTH);
cache->loaded |= IMG_FLAG_DONT_REMOVE;
if (uf->scheme != SCM_LOCAL)
newBuf->sourcefile = cache->file;
tmp = Sprintf("<img src=\"%s\"><br><br>", html_quote(image->url));
- if (newBuf == NULL)
- newBuf = newBuffer(INIT_BUFFER_WIDTH);
tmpf = tmpfname(TMPF_SRC, ".html");
src = fopen(tmpf->ptr, "w");
newBuf->mailcap_source = tmpf->ptr;