From 0cf4f52a13161e1ed57ecf4e682d3bb945528cb8 Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Thu, 9 Jan 2003 15:30:20 +0000 Subject: [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 --- file.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'file.c') 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 #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("

", html_quote(image->url)); -- cgit v1.2.3