diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-23 16:05:54 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-23 16:05:54 +0000 |
commit | 51c2899aa90b29de39c21fad02481123f8fab2ad (patch) | |
tree | 691f49842030c6709e2d409aac097f86ddf2f4a2 | |
parent | fix indent (diff) | |
download | w3m-51c2899aa90b29de39c21fad02481123f8fab2ad.tar.gz w3m-51c2899aa90b29de39c21fad02481123f8fab2ad.zip |
[w3m-dev 03680] showProgress() on fast system
* file.c (showProgress): check line len, time
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | file.c | 18 |
2 files changed, 16 insertions, 9 deletions
@@ -1,5 +1,10 @@ 2003-01-24 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + * [w3m-dev 03680] showProgress() on fast system + * file.c (showProgress): check line len, time + +2003-01-24 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + * [w3m-dev 03679] Re: cleanup for pipe * etc.c (open_pipe_rw): check stdin, stdout * file.c (uncompress_stream): rewrite @@ -6721,4 +6726,4 @@ a * [w3m-dev 03276] compile error on EWS4800 * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.706 2003/01/23 15:59:24 ukai Exp $ +$Id: ChangeLog,v 1.707 2003/01/23 16:05:54 ukai Exp $ @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.201 2003/01/23 15:59:27 ukai Exp $ */ +/* $Id: file.c,v 1.202 2003/01/23 16:05:56 ukai Exp $ */ #include "fm.h" #include <sys/types.h> #include "myctype.h" @@ -6182,12 +6182,11 @@ showProgress(clen_t * linelen, clen_t * trbyte) if (!fmInitialized) return; + if (*linelen < 1024) + return; if (current_content_length > 0) { double ratio; cur_time = time(0); - if (cur_time == last_time) - return; - last_time = cur_time; if (*trbyte == 0) { move(LASTLINE, 0); clrtoeolx(); @@ -6195,6 +6194,9 @@ showProgress(clen_t * linelen, clen_t * trbyte) } *trbyte += *linelen; *linelen = 0; + if (cur_time == last_time) + return; + last_time = cur_time; move(LASTLINE, 0); ratio = 100.0 * (*trbyte) / current_content_length; fmtrbyte = convert_size2(*trbyte, current_content_length, 1); @@ -6231,11 +6233,8 @@ showProgress(clen_t * linelen, clen_t * trbyte) /* no_clrtoeol(); */ refresh(); } - else if (*linelen > 1000) { + else { cur_time = time(0); - if (cur_time == last_time) - return; - last_time = cur_time; if (*trbyte == 0) { move(LASTLINE, 0); clrtoeolx(); @@ -6243,6 +6242,9 @@ showProgress(clen_t * linelen, clen_t * trbyte) } *trbyte += *linelen; *linelen = 0; + if (cur_time == last_time) + return; + last_time = cur_time; move(LASTLINE, 0); fmtrbyte = convert_size(*trbyte, 1); duration = cur_time - start_time; |