]> 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:27:25 +0000 (00:27 +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)
(cherry picked from commit 7d3418e496d00287d08a7f5af265379b757247a6)

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

index ca8a4680b688a6576dba8f76ee462c5b2774970b..90bb69fd07beb371dd11e5cddcc776e9c75e1dca 100644 (file)
@@ -156,7 +156,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 064a04504444820048ae0a81fed64129a9c5e61e..c7c24dce5d96f2ed8e323286be7002b278a3182b 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 d7af1cd9c52a7b065cb9ffc1aacc44935743ebab..bed9cbd4e714a6b9534037277c32050a405324f4 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.
 ///