diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-08-20 17:49:38 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-08-20 17:49:38 +0000 |
commit | d404404dda40eab419b37f8136920e8edf38d401 (patch) | |
tree | ce4ccf54721997c7f4385cdc0daeb5f323873e53 /file.c | |
parent | Debian Bug#154766: w3m-img: support DirectColor framebuffer visuals? (diff) | |
download | w3m-d404404dda40eab419b37f8136920e8edf38d401.tar.gz w3m-d404404dda40eab419b37f8136920e8edf38d401.zip |
Debian Bug#157098: wrong file presentation on large files
from "Eduard Bloch" <blade@debian.org>
* configure (clen_t): added
(HAVE_STRTOLL): added
(HAVE_STRTOQ): added
(HAVE_ATOLL): added
(HAVE_ATOQ): added
* config.h.dist: ditto
* file.c (current_content_length): s/int/clen_t/
(loadGeneralFile): s/atoi/strtoclen/
(convert_size): s/int/clen_t/
(convert_size2): s/int/clen_t/
(showProgress): s/int/clen_t/
(loadHTMLstream): s/int/clen_t/ linelen, trbyte
(loadBuffer): ditto
(getNextPage): s/int/clen_t/ linelen
(save2tmp): s/int/clen_t/ linelen, trbye
(_MoveFile): s/int/clen_t/ linelen, trbye
* fm.h (_Buffer): s/int/clen_t/ linelen, trbye
* ftp.c (size_int2str): s/long/clen_t/
(ex_ftpdir_name_size_date): s/long/clen_t/
* indep.c (strtoclen): added
* indep.h (strtoclen): added
* proto.h (showProgress): s/int/clen_t/
From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.94 2002/07/19 03:24:28 ukai Exp $ */ +/* $Id: file.c,v 1.95 2002/08/20 17:49:39 ukai Exp $ */ #include "fm.h" #include <sys/types.h> #include "myctype.h" @@ -120,7 +120,7 @@ static int forms_size = 0; #define cur_form_id ((form_sp >= 0)? form_stack[form_sp] : -1) static int form_sp = 0; -static int current_content_length; +static clen_t current_content_length; static int cur_hseq; #ifdef USE_IMAGE @@ -1950,7 +1950,7 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer, current_content_length = 0; if ((p = checkHeader(t_buf, "Content-Length:")) != NULL) - current_content_length = atoi(p); + current_content_length = strtoclen(p); if (flag & RG_FRAME) { t_buf = newBuffer(INIT_BUFFER_WIDTH); @@ -5777,7 +5777,7 @@ static char *_size_unit[] = { "b", "kb", "Mb", "Gb", "Tb", }; char * -convert_size(int size, int usefloat) +convert_size(clen_t size, int usefloat) { float csize; int sizepos = 0; @@ -5793,7 +5793,7 @@ convert_size(int size, int usefloat) } char * -convert_size2(int size1, int size2, int usefloat) +convert_size2(clen_t size1, clen_t size2, int usefloat) { char **sizes = _size_unit; float csize, factor = 1; @@ -5811,7 +5811,7 @@ convert_size2(int size1, int size2, int usefloat) } void -showProgress(int *linelen, int *trbyte) +showProgress(clen_t *linelen, clen_t *trbyte) { int i, j, rate, duration, eta, pos; static time_t last_time, start_time; @@ -6052,8 +6052,8 @@ void loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal) { struct environment envs[MAX_ENV_LEVEL]; - int linelen = 0; - int trbyte = 0; + clen_t linelen = 0; + clen_t trbyte = 0; Str lineBuf2 = Strnew(); char code; struct html_feed_environ htmlenv1; @@ -6396,7 +6396,7 @@ loadBuffer(URLFile *uf, Buffer *volatile newBuf) volatile char pre_lbuf = '\0'; int nlines; Str tmpf; - int linelen = 0, trbyte = 0; + clen_t linelen = 0, trbyte = 0; #ifdef USE_ANSI_COLOR int check_color; #endif @@ -6776,7 +6776,7 @@ getNextPage(Buffer *buf, int plen) Line *l, *fl, *pl = buf->lastLine; Line *rl = NULL; int len, i, nlines = 0; - int linelen = buf->linelen, trbyte = buf->trbyte; + clen_t linelen = buf->linelen, trbyte = buf->trbyte; Str lineBuf2; char pre_lbuf = '\0'; URLFile uf; @@ -6920,7 +6920,7 @@ save2tmp(URLFile uf, char *tmpf) { FILE *ff; int check; - int linelen = 0, trbyte = 0; + clen_t linelen = 0, trbyte = 0; MySignalHandler(*volatile prevtrap) (SIGNAL_ARG) = NULL; static JMP_BUF env_bak; @@ -7073,7 +7073,7 @@ _MoveFile(char *path1, char *path2) InputStream f1; FILE *f2; int is_pipe; - int linelen = 0, trbyte = 0; + clen_t linelen = 0, trbyte = 0; Str buf; f1 = openIS(path1); |