mirror of
https://github.com/curl/curl.git
synced 2026-07-23 16:37:18 +03:00
tool: improve --stderr handling
- freopen stderr with the user-specified file (--stderr file) instead of using a separate 'errors' stream. - In tool_setup.h override stdio.h's stderr macro as global variable tool_stderr. Both freopen and overriding the stderr macro are necessary because if the user-specified filename is "-" then stdout is assigned to tool_stderr and no freopen takes place. See the PR for more information. Ref: https://github.com/curl/curl/issues/10491 Closes https://github.com/curl/curl/pull/10673
This commit is contained in:
parent
395b9175b7
commit
2f17a9b654
14 changed files with 151 additions and 60 deletions
|
|
@ -173,7 +173,7 @@ bool progress_meter(struct GlobalConfig *global,
|
|||
header = TRUE;
|
||||
fputs("DL% UL% Dled Uled Xfers Live "
|
||||
"Total Current Left Speed\n",
|
||||
global->errors);
|
||||
stderr);
|
||||
}
|
||||
if(final || (diff > 500)) {
|
||||
char time_left[10];
|
||||
|
|
@ -275,7 +275,7 @@ bool progress_meter(struct GlobalConfig *global,
|
|||
}
|
||||
time2str(time_spent, spent);
|
||||
|
||||
fprintf(global->errors,
|
||||
fprintf(stderr,
|
||||
"\r"
|
||||
"%-3s " /* percent downloaded */
|
||||
"%-3s " /* percent uploaded */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue