diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-10 16:08:19 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-10 16:08:19 +0000 |
commit | 900d16573c6efcdca06925ca66f9fe9ef5a845ec (patch) | |
tree | 024475070996701b912eab600528e8cc63a43754 /file.c | |
parent | [w3m-dev 03619] Re: Error occured while reset (diff) | |
download | w3m-900d16573c6efcdca06925ca66f9fe9ef5a845ec.tar.gz w3m-900d16573c6efcdca06925ca66f9fe9ef5a845ec.zip |
[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 <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r-- | file.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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 <sys/types.h> #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; |