aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2003-01-09 15:30:20 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2003-01-09 15:30:20 +0000
commit0cf4f52a13161e1ed57ecf4e682d3bb945528cb8 (patch)
tree9392549495a5321f60c061064b287b7777e9bfd7 /file.c
parent[w3m-dev 03617] sourcefile when Content-Encoding: is specified. (diff)
downloadw3m-0cf4f52a13161e1ed57ecf4e682d3bb945528cb8.tar.gz
w3m-0cf4f52a13161e1ed57ecf4e682d3bb945528cb8.zip
[w3m-dev 03619] Re: Error occured while reset
* file.c (process_img): check image.ext (HTMLlineproc2body): check image.ext (loadImageBuffer): url, ext is in URLFile * frame.c (unloadFrame): no need to push to fileToDelete (copyFrame): no need to reset FB_TODELETE (resetFrameElement): f_body->source, buf->sourcefile (frame_download_source): buf->source buf->sourcefile reset * frame.h (FB_NOCACHE): deleted (FB_TODELETE): deleted * main.c (vmSrc): Currentbuf->sourcefile need_reshape if images exist From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r--file.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/file.c b/file.c
index e5d4f72..6f8fb58 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.177 2003/01/08 17:32:54 ukai Exp $ */
+/* $Id: file.c,v 1.178 2003/01/09 15:30:34 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -3122,7 +3122,8 @@ process_img(struct parsed_tag *tag, int width)
parseURL2(p, &u, cur_baseURL);
#endif
image.url = parsedURL2Str(&u)->ptr;
- image.ext = filename_extension(u.file, TRUE);
+ if (!uncompressed_file_type(u.file, &image.ext))
+ image.ext = filename_extension(u.file, TRUE);
image.cache = NULL;
image.width = w;
image.height = i;
@@ -5171,7 +5172,8 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
parseURL2(a_img->url, &u, cur_baseURL);
a_img->image = image = New(Image);
image->url = parsedURL2Str(&u)->ptr;
- image->ext = filename_extension(u.file, TRUE);
+ if (!uncompressed_file_type(u.file, &image->ext))
+ image->ext = filename_extension(u.file, TRUE);
image->cache = NULL;
image->width =
(w > MAX_IMAGE_SIZE) ? MAX_IMAGE_SIZE : w;
@@ -6843,8 +6845,8 @@ loadImageBuffer(URLFile *uf, Buffer *newBuf)
loadImage(IMG_FLAG_STOP);
image = New(Image);
- image->url = parsedURL2Str(cur_baseURL)->ptr;
- image->ext = filename_extension(cur_baseURL->file, 1);
+ image->url = uf->url;
+ image->ext = uf->ext;
image->width = -1;
image->height = -1;
cache = getImage(image, cur_baseURL, IMG_FLAG_AUTO);
@@ -6876,7 +6878,7 @@ loadImageBuffer(URLFile *uf, Buffer *newBuf)
if (newBuf == NULL)
newBuf = newBuffer(INIT_BUFFER_WIDTH);
cache->loaded |= IMG_FLAG_DONT_REMOVE;
- if (uf->scheme != SCM_LOCAL)
+ if (newBuf->sourcefile == NULL && uf->scheme != SCM_LOCAL)
newBuf->sourcefile = cache->file;
tmp = Sprintf("<img src=\"%s\"><br><br>", html_quote(image->url));