diff -pru dillo/dpi/downloads.cc dillo-cur/dpi/downloads.cc --- dillo/dpi/downloads.cc 2006-03-24 12:27:19.000000000 -0400 +++ dillo-cur/dpi/downloads.cc 2006-03-29 09:29:32.000000000 -0400 @@ -107,7 +107,7 @@ public: class DLItem { enum { - ST_newline, ST_discard, ST_copy + ST_newline, ST_number, ST_discard, ST_copy }; pid_t mPid; @@ -489,19 +489,30 @@ void DLItem::log_text_add(char *buf, ssi prTitle->tooltip(log_text); } - // FSM to remove lines starting with a space (wget's "dot-progress") + // FSM to remove wget's "dot-progress" (i.e. "^ " || "^[0-9]+K") q = log_text + log_len; for (p = buf; (p - buf) < st; ++p) { switch (log_state) { case ST_newline: if (*p == ' ') { log_state = ST_discard; + } else if (isdigit(*p)) { + *q++ = *p; log_state = ST_number; } else if (*p == '\n') { *q++ = *p; } else { *q++ = *p; log_state = ST_copy; } break; + case ST_number: + if (isdigit(*q++ = *p)) { + // keep here + } else if (*p == 'K') { + for(--q; isdigit(q[-1]); --q); log_state = ST_discard; + } else { + log_state = ST_copy; + } + break; case ST_discard: if (*p == '\n') log_state = ST_newline;