diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-09 15:30:20 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-09 15:30:20 +0000 |
commit | 0cf4f52a13161e1ed57ecf4e682d3bb945528cb8 (patch) | |
tree | 9392549495a5321f60c061064b287b7777e9bfd7 | |
parent | [w3m-dev 03617] sourcefile when Content-Encoding: is specified. (diff) | |
download | w3m-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>
-rw-r--r-- | ChangeLog | 18 | ||||
-rw-r--r-- | file.c | 14 | ||||
-rw-r--r-- | frame.c | 35 | ||||
-rw-r--r-- | frame.h | 6 | ||||
-rw-r--r-- | main.c | 7 |
5 files changed, 38 insertions, 42 deletions
@@ -1,3 +1,19 @@ +2003-01-10 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [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 + 2003-01-09 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> * [w3m-dev 03617] sourcefile when Content-Encoding: is specified. @@ -6228,4 +6244,4 @@ a * [w3m-dev 03276] compile error on EWS4800 * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.660 2003/01/08 17:32:36 ukai Exp $ +$Id: ChangeLog,v 1.661 2003/01/09 15:30:20 ukai Exp $ @@ -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)); @@ -1,4 +1,4 @@ -/* $Id: frame.c,v 1.27 2002/12/14 15:28:37 ukai Exp $ */ +/* $Id: frame.c,v 1.28 2003/01/09 15:30:43 ukai Exp $ */ #include "fm.h" #include "parsetagx.h" #include "myctype.h" @@ -107,8 +107,6 @@ newFrame(struct parsed_tag *tag, Buffer *buf) static void unloadFrame(struct frame_body *b) { - if (b->source && b->flags & FB_TODELETE) - pushText(fileToDelete, b->source); b->attr = F_UNLOADED; } @@ -177,7 +175,6 @@ copyFrame(struct frame_body *ob) rb = New(struct frame_body); bcopy((const void *)ob, (void *)rb, sizeof(struct frame_body)); - rb->flags &= ~FB_TODELETE; return rb; } @@ -316,21 +313,12 @@ resetFrameElement(union frameset_element *f_element, f_body->attr = F_BODY; f_body->name = f_name; f_body->url = parsedURL2Str(&buf->currentURL)->ptr; + f_body->source = buf->sourcefile; + buf->sourcefile = NULL; if (buf->mailcap_source) { f_body->source = buf->mailcap_source; - f_body->flags |= FB_TODELETE; buf->mailcap_source = NULL; } - else if (buf->real_scheme == SCM_LOCAL) { - f_body->source = buf->sourcefile; - } - else { - Str tmp = tmpfname(TMPF_FRAME, NULL); - rename(buf->sourcefile, tmp->ptr); - f_body->source = tmp->ptr; - f_body->flags |= FB_TODELETE; - buf->sourcefile = NULL; - } f_body->type = buf->type; f_body->referer = referer; f_body->request = request; @@ -345,7 +333,6 @@ frame_download_source(struct frame_body *b, ParsedURL *currentURL, { Buffer *buf; struct frameset *ret_frameset = NULL; - Str tmp; ParsedURL url; if (b == NULL || b->url == NULL || b->url[0] == '\0') @@ -381,25 +368,13 @@ frame_download_source(struct frame_body *b, ParsedURL *currentURL, return NULL; } b->url = parsedURL2Str(&buf->currentURL)->ptr; - b->source = buf->sourcefile; b->type = buf->type; + b->source = buf->sourcefile; + buf->sourcefile = NULL; if (buf->mailcap_source) { b->source = buf->mailcap_source; - b->flags |= FB_TODELETE; buf->mailcap_source = NULL; } - else if ((buf->real_scheme != SCM_LOCAL) -#ifdef USE_IMAGE - || (activeImage && !useExtImageViewer && - buf->real_type && !strncasecmp(buf->real_type, "image/", 6)) -#endif - ) { - tmp = tmpfname(TMPF_FRAME, NULL); - rename(buf->sourcefile, tmp->ptr); - b->source = tmp->ptr; - b->flags |= FB_TODELETE; - buf->sourcefile = NULL; - } b->attr = F_BODY; if (buf->frameset) { ret_frameset = buf->frameset; @@ -1,4 +1,4 @@ -/* $Id: frame.h,v 1.4 2002/02/08 11:45:07 ukai Exp $ */ +/* $Id: frame.h,v 1.5 2003/01/09 15:30:46 ukai Exp $ */ /* * frame support */ @@ -15,9 +15,7 @@ struct frame_element { struct frame_body { char attr; char flags; -#define FB_NOCACHE 0x01 -#define FB_TODELETE 0x02 -#define FB_NO_BUFFER 0x04 +#define FB_NO_BUFFER 0x01 char *name; char *url; ParsedURL *baseURL; @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.185 2003/01/08 17:24:13 ukai Exp $ */ +/* $Id: main.c,v 1.186 2003/01/09 15:30:48 ukai Exp $ */ #define MAINPROGRAM #include "fm.h" #include <signal.h> @@ -4392,6 +4392,7 @@ vwSrc(void) saveBuffer(Currentbuf, f); fclose(f); fn = tmpf->ptr; + Currentbuf->sourcefile = fn; } else { return; @@ -4441,6 +4442,10 @@ vwSrc(void) Sprintf("HTML view of %s", Currentbuf->buffername)->ptr; buf->linkBuffer[LB_SOURCE] = Currentbuf; Currentbuf->linkBuffer[LB_N_SOURCE] = buf; +#ifdef USE_IMAGE + if (buf->img) + buf->need_reshape = TRUE; +#endif } else { return; |