diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2024-02-17 23:07:35 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2024-02-17 23:07:35 +0200 |
commit | c701a5909ad9882469fbab4fab5d2d5556d3ba78 (patch) | |
tree | 5f78498911f919bd37c9fc7689127298241cd47e | |
parent | Build: Makefile.am: Sort EXTRA_DIST. (diff) | |
download | xz-c701a5909ad9882469fbab4fab5d2d5556d3ba78.tar.xz |
xz: Fix message_init() description.
Also explicitly initialize progress_automatic to make it clear
that it can be read before message_init() sets it. Static variable
was initialized to false by default already so this is only for
clarity.
-rw-r--r-- | src/xz/main.c | 3 | ||||
-rw-r--r-- | src/xz/message.c | 2 | ||||
-rw-r--r-- | src/xz/message.h | 5 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/xz/main.c b/src/xz/main.c index 14502573..0685bc27 100644 --- a/src/xz/main.c +++ b/src/xz/main.c @@ -188,7 +188,8 @@ main(int argc, char **argv) // Set up the locale and message translations. tuklib_gettext_init(PACKAGE, LOCALEDIR); - // Initialize handling of error/warning/other messages. + // Initialize progress message handling. It's not always needed + // but it's simpler to do this unconditionally. message_init(); // Set hardware-dependent default values. These can be overridden diff --git a/src/xz/message.c b/src/xz/message.c index 46d7f0c8..0dfbebe1 100644 --- a/src/xz/message.c +++ b/src/xz/message.c @@ -42,7 +42,7 @@ static bool current_filename_printed = false; /// True if we should print progress indicator and update it automatically /// if also verbose >= V_VERBOSE. -static bool progress_automatic; +static bool progress_automatic = false; /// True if message_progress_start() has been called but /// message_progress_end() hasn't been called yet. diff --git a/src/xz/message.h b/src/xz/message.h index fd3333a7..1734f0ea 100644 --- a/src/xz/message.h +++ b/src/xz/message.h @@ -23,7 +23,10 @@ enum message_verbosity { extern const int message_progress_sigs[]; -/// \brief Initializes the message functions +/// \brief Initializes the progress message functions +/// +/// message_fatal() and such can be called even before message_init() +/// has been called. /// /// If an error occurs, this function doesn't return. /// |