]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
xz: Fix message_init() description.
authorLasse Collin <lasse.collin@tukaani.org>
Sat, 17 Feb 2024 21:07:35 +0000 (23:07 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Tue, 21 May 2024 21:07:08 +0000 (00:07 +0300)
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.

(cherry picked from commit c701a5909ad9882469fbab4fab5d2d5556d3ba78)

src/xz/main.c
src/xz/message.c
src/xz/message.h

index c9c3deca2bf87749e84b709a78eb825e98daf063..9c2920b72fc3c25a4bf47b8f3e450bde40a38cb2 100644 (file)
@@ -170,7 +170,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
index dec0addd6367ba8073b7a0e6eee08c20b3eb737d..430d6fb8856105c0841e0e84b7d8d10c69f0cbb2 100644 (file)
@@ -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.
index f608ec75dffaa2e453dbbcdc378927a34fd35553..2a96573b6b801dcc2cb5fe420b32668eeb0613a9 100644 (file)
@@ -24,7 +24,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.
 ///