mirror of
https://github.com/curl/curl.git
synced 2026-07-10 06:47:18 +03:00
tool: init progress bar on demand
Determine the terminal size on first invocation, not for all transfers. Closes #22164
This commit is contained in:
parent
c6c4c6a16d
commit
46e19c8744
1 changed files with 3 additions and 2 deletions
|
|
@ -129,6 +129,9 @@ int tool_progress_cb(void *clientp,
|
|||
curl_off_t total;
|
||||
curl_off_t point;
|
||||
|
||||
if(!bar->calls)
|
||||
update_width(bar);
|
||||
|
||||
/* Calculate expected transfer size. initial_size can be less than zero when
|
||||
indicating that we are expecting to get the filesize from the remote */
|
||||
if(bar->initial_size < 0) {
|
||||
|
|
@ -230,8 +233,6 @@ void progressbarinit(struct ProgressData *bar, struct OperationConfig *config)
|
|||
if(config->use_resume)
|
||||
bar->initial_size = config->resume_from;
|
||||
|
||||
update_width(bar);
|
||||
|
||||
bar->out = tool_stderr;
|
||||
bar->tick = 150;
|
||||
bar->barmove = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue