diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2008-11-28 12:00:48 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2008-11-28 12:00:48 +0200 |
commit | c7007ddf06ac2b0e018d71d281c21b99f16e7ae0 (patch) | |
tree | fa3f6c17a6db4e0f4a1ef28690c102e1823f68ec | |
parent | Cleanups to message.c. (diff) | |
download | xz-c7007ddf06ac2b0e018d71d281c21b99f16e7ae0.tar.xz |
Tested using COLUMNS environment variable to avoid broken
progress indicator but since COLUMNS isn't usually available,
the code was left commented out.
-rw-r--r-- | src/xz/message.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/xz/message.c b/src/xz/message.c index 274b4e9f..0e1f2bc4 100644 --- a/src/xz/message.c +++ b/src/xz/message.c @@ -147,6 +147,9 @@ message_init(const char *given_argv0) // updating. 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) { // 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 // that the terminal is wide enough. const char *columns_str = getenv("COLUMNS"); - uint64_t columns; - if (columns_str != NULL - && !str_to_uint64_raw(&columns, columns_str) - && columns < 80) - progress_automatic = false; + if (columns_str != NULL) { + char *endptr; + const long columns = strtol(columns_str, &endptr, 10); + if (*endptr != '\0' || columns < 80) + progress_automatic = false; + } } */ |