mirror of
https://git.tukaani.org/xz.git
synced 2024-04-04 12:36:23 +02:00
Tested using COLUMNS environment variable to avoid broken
progress indicator but since COLUMNS isn't usually available, the code was left commented out.
This commit is contained in:
parent
ae65dcfde2
commit
c7007ddf06
1 changed files with 9 additions and 5 deletions
|
@ -147,6 +147,9 @@ message_init(const char *given_argv0)
|
||||||
// updating.
|
// updating.
|
||||||
progress_automatic = isatty(STDERR_FILENO);
|
progress_automatic = isatty(STDERR_FILENO);
|
||||||
|
|
||||||
|
// Commented out because COLUMNS is rarely exported to environment.
|
||||||
|
// Most users have at least 80 columns anyway, let's think something
|
||||||
|
// fancy here if enough people complain.
|
||||||
/*
|
/*
|
||||||
if (progress_automatic) {
|
if (progress_automatic) {
|
||||||
// stderr is a terminal. Check the COLUMNS environment
|
// stderr is a terminal. Check the COLUMNS environment
|
||||||
|
@ -154,11 +157,12 @@ message_init(const char *given_argv0)
|
||||||
// doesn't exist or it has some unparseable value, we assume
|
// doesn't exist or it has some unparseable value, we assume
|
||||||
// that the terminal is wide enough.
|
// that the terminal is wide enough.
|
||||||
const char *columns_str = getenv("COLUMNS");
|
const char *columns_str = getenv("COLUMNS");
|
||||||
uint64_t columns;
|
if (columns_str != NULL) {
|
||||||
if (columns_str != NULL
|
char *endptr;
|
||||||
&& !str_to_uint64_raw(&columns, columns_str)
|
const long columns = strtol(columns_str, &endptr, 10);
|
||||||
&& columns < 80)
|
if (*endptr != '\0' || columns < 80)
|
||||||
progress_automatic = false;
|
progress_automatic = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue