diff options
Diffstat (limited to 'file.c')
-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; |