diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-28 16:40:58 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-28 16:40:58 +0000 |
commit | 58259b5c340410d6025e592d78db6f6987316d5e (patch) | |
tree | 4007807744841a5a0f7462102f992e760059ce72 /file.c | |
parent | [w3m-dev 03705] goodict.cgi (was: Re: google.cgi (was: Re: keymap key SEARCH ... (diff) | |
download | w3m-58259b5c340410d6025e592d78db6f6987316d5e.tar.gz w3m-58259b5c340410d6025e592d78db6f6987316d5e.zip |
[w3m-dev 03706] X-Image-URL: support, bug fix of reshapeBuffer()
* buffer.c (reshapeBuffer): rewrite
* file.c (readHeader): rewrite
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r-- | file.c | 44 |
1 files changed, 27 insertions, 17 deletions
@@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.209 2003/01/24 17:57:54 ukai Exp $ */ +/* $Id: file.c,v 1.210 2003/01/28 16:41:05 ukai Exp $ */ #include "fm.h" #include <sys/types.h> #include "myctype.h" @@ -669,24 +669,34 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu) for (; *q && (*q == '\r' || *q == '\n'); q++) ; } #ifdef USE_IMAGE + if (thru && activeImage && displayImage) { + Str src = NULL; + if (!strncasecmp(tmp->ptr, "X-Image-URL:", 12)) { + tmpf = &tmp->ptr[12]; + SKIP_BLANKS(tmpf); + src = Strnew_m_charp("<img src=\"", html_quote(tmpf), + "\" alt=\"X-Image-URL\">", NULL); + } #ifdef USE_XFACE - if (thru && activeImage && displayImage && - !strncasecmp(tmp->ptr, "X-Face:", 7) && - (tmpf = xface2xpm(&tmp->ptr[7])) != NULL) { - Str src; - URLFile f; - Line *l; - - src = Strnew_m_charp("<img src=\"file:", html_quote(tmpf), - "\" alt=\"X-Face\" width=48 height=48>", - NULL); - init_stream(&f, SCM_LOCAL, newStrStream(src)); - loadHTMLstream(&f, newBuf, NULL, TRUE); - for (l = newBuf->lastLine; l && l->real_linenumber; - l = l->prev) - l->real_linenumber = 0; - } + else if (!strncasecmp(tmp->ptr, "X-Face:", 7)) { + tmpf = xface2xpm(&tmp->ptr[7]); + if (tmpf) + src = Strnew_m_charp("<img src=\"file:", + html_quote(tmpf), + "\" alt=\"X-Face\"", + " width=48 height=48>", NULL); + } #endif + if (src) { + URLFile f; + Line *l; + init_stream(&f, SCM_LOCAL, newStrStream(src)); + loadHTMLstream(&f, newBuf, NULL, TRUE); + for (l = newBuf->lastLine; l && l->real_linenumber; + l = l->prev) + l->real_linenumber = 0; + } + } #endif lineBuf2 = tmp; } |