From 739eb5f7ab4d8d10e054ba80813bc1d9e3307450 Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Thu, 14 Mar 2002 16:12:02 +0000 Subject: [w3m-dev 03129] Re: X-Face * configure (use_xface): ask * fm.h (_Buffer): add header_source * buffer.c (reshapeBuffer): fix reshape when reading stdin with image fix disappearing header when reading stdin * file.c (xface2xbm): check file existence * file.c (readHeader): save to tmp file X-Face when activeImage & displayImage * main.c (dispI): comment out checking content type * main.c (stopI): ditto * scripts/xface2xbm.in: update compface URL read from file $XF write to file $XBM From: Hironori Sakamoto --- buffer.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'buffer.c') diff --git a/buffer.c b/buffer.c index 4c341fa..183175b 100644 --- a/buffer.c +++ b/buffer.c @@ -1,4 +1,4 @@ -/* $Id: buffer.c,v 1.11 2002/03/13 15:51:36 ukai Exp $ */ +/* $Id: buffer.c,v 1.12 2002/03/14 16:12:05 ukai Exp $ */ #include "fm.h" #ifdef USE_MOUSE @@ -497,15 +497,11 @@ reshapeBuffer(Buffer *buf) buf->need_reshape = FALSE; if (buf->sourcefile == NULL) return; - if (buf->currentURL.scheme == SCM_LOCAL && - !strcmp(buf->currentURL.file, "-")) - return; init_stream(&f, SCM_LOCAL, NULL); examineFile(buf->mailcap_source ? buf->mailcap_source : buf->sourcefile, &f); if (f.stream == NULL) return; - copyBuffer(&sbuf, buf); clearBuffer(buf); while (buf->frameset) { @@ -523,8 +519,21 @@ reshapeBuffer(Buffer *buf) UseContentCharset = FALSE; UseAutoDetect = FALSE; #endif - if (buf->search_header && buf->currentURL.scheme == SCM_LOCAL) - readHeader(&f, buf, TRUE, NULL); + if (buf->search_header && buf->currentURL.scheme == SCM_LOCAL) { + if (buf->header_source && (buf->mailcap_source || + !strcmp(buf->currentURL.file, "-"))) { + URLFile h; + init_stream(&h, SCM_LOCAL, NULL); + examineFile(buf->header_source, &h); + if (h.stream) { + readHeader(&h, buf, TRUE, NULL); + UFclose(&h); + } + } + else + readHeader(&f, buf, TRUE, NULL); + } + if (!strcasecmp(buf->type, "text/html")) loadHTMLBuffer(&f, buf); else -- cgit v1.2.3