]> 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>
Sat, 17 Feb 2024 21:07:35 +0000 (23:07 +0200)
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.

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

index 14502573e13fd3863f3b6ab8e0b2af3a9015bfb4..0685bc27c69851cf27cbde8627b315c5dd85a831 100644 (file)
@@ -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
index 46d7f0c85a97c25a94848932308cce16d515b14a..0dfbebe1b72c6a1599f7f12272d734853b5d5daa 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 fd3333a7ee1c4bbc7739d47410646b4a7ea1703b..1734f0eaab6807c1a36e77629eb0afe4567ebdcd 100644 (file)
@@ -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.
 ///