From 900d16573c6efcdca06925ca66f9fe9ef5a845ec Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Fri, 10 Jan 2003 16:08:19 +0000 Subject: [w3m-dev 03620] -m option and header * buffer.c (reshapeBuffer): fix reading from stdin fix -m option * display.c (redrawNLine): rewrite (redrawLine): return l instead of l->next (redrawLineImage): ditto * file.c (loadFile): read header even if skip header (loadGeneralFile): read header even if skip header * fm.h (SkipHeader): added * main.c (main): check whether reading from stdin SkipHeader From: Hironori SAKAMOTO --- file.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index 6f8fb58..b57b016 100644 --- a/file.c +++ b/file.c @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.178 2003/01/09 15:30:34 ukai Exp $ */ +/* $Id: file.c,v 1.179 2003/01/10 16:08:21 ukai Exp $ */ #include "fm.h" #include #include "myctype.h" @@ -472,16 +472,20 @@ convertLine(URLFile *uf, Str line, char *code, int mode) Buffer * loadFile(char *path) { + Buffer *buf; URLFile uf; init_stream(&uf, SCM_LOCAL, NULL); examineFile(path, &uf); if (uf.stream == NULL) return NULL; + buf = newBuffer(INIT_BUFFER_WIDTH); + if (SkipHeader) + readHeader(&uf, buf, TRUE, NULL); current_content_length = 0; #ifdef JP_CHARSET content_charset = '\0'; #endif - return loadSomething(&uf, path, loadBuffer, NULL); + return loadSomething(&uf, path, loadBuffer, buf); } int @@ -1907,6 +1911,10 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer, if (f.guess_type) t = f.guess_type; } + if (SkipHeader) { + t_buf = newBuffer(INIT_BUFFER_WIDTH); + readHeader(&f, t_buf, TRUE, NULL); + } if (real_type == NULL) real_type = t; proc = loadBuffer; -- cgit v1.2.3