summaryrefslogtreecommitdiffstats
path: root/contrib/xz/src/lzmainfo
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/xz/src/lzmainfo')
-rw-r--r--contrib/xz/src/lzmainfo/lzmainfo.127
-rw-r--r--contrib/xz/src/lzmainfo/lzmainfo.c13
2 files changed, 27 insertions, 13 deletions
diff --git a/contrib/xz/src/lzmainfo/lzmainfo.1 b/contrib/xz/src/lzmainfo/lzmainfo.1
index ef736a6..f2b93b4 100644
--- a/contrib/xz/src/lzmainfo/lzmainfo.1
+++ b/contrib/xz/src/lzmainfo/lzmainfo.1
@@ -4,9 +4,9 @@
.\" This file has been put into the public domain.
.\" You can do whatever you want with this file.
.\"
-.TH LZMAINFO 1 "2009-08-13" "Tukaani" "XZ Utils"
+.TH LZMAINFO 1 "2010-09-27" "Tukaani" "XZ Utils"
.SH NAME
-lzmainfo \- show infomation stored in the .lzma file header
+lzmainfo \- show information stored in the .lzma file header
.SH SYNOPSIS
.B lzmainfo
.RB [ \-\-help ]
@@ -16,10 +16,12 @@ lzmainfo \- show infomation stored in the .lzma file header
.B lzmainfo
shows information stored in the
.B .lzma
-file header. It reads the first 13 bytes from the specified
+file header.
+It reads the first 13 bytes from the specified
.IR file ,
decodes the header, and prints it to standard output in human
-readable format. If no
+readable format.
+If no
.I files
are given or
.I file
@@ -27,16 +29,19 @@ is
.BR \- ,
standard input is read.
.PP
-Usually the most interesting information is the uncompressed size and
-the dictionary size. Uncompressed size can be shown only if the file is
-in the non-streamed
+Usually the most interesting information is
+the uncompressed size and the dictionary size.
+Uncompressed size can be shown only if
+the file is in the non-streamed
.B .lzma
-format variant. The amount of memory required to decompress the file is
+format variant.
+The amount of memory required to decompress the file is
a few dozen kilobytes plus the dictionary size.
.PP
.B lzmainfo
-is included in XZ Utils primarily for backward compatibility with LZMA Utils.
-.SH EXIT STATUS
+is included in XZ Utils primarily for
+backward compatibility with LZMA Utils.
+.SH "EXIT STATUS"
.TP
.B 0
All is good.
@@ -51,5 +56,5 @@ while the correct suffix would be
.B MiB
(2^20 bytes).
This is to keep the output compatible with LZMA Utils.
-.SH SEE ALSO
+.SH "SEE ALSO"
.BR xz (1)
diff --git a/contrib/xz/src/lzmainfo/lzmainfo.c b/contrib/xz/src/lzmainfo/lzmainfo.c
index af8e66c..3100dc6 100644
--- a/contrib/xz/src/lzmainfo/lzmainfo.c
+++ b/contrib/xz/src/lzmainfo/lzmainfo.c
@@ -20,6 +20,11 @@
#include "tuklib_progname.h"
#include "tuklib_exit.h"
+#ifdef TUKLIB_DOSLIKE
+# include <fcntl.h>
+# include <io.h>
+#endif
+
static void lzma_attribute((noreturn))
help(void)
@@ -43,7 +48,7 @@ _("Usage: %s [--help] [--version] [FILE]...\n"
static void lzma_attribute((noreturn))
version(void)
{
- puts("lzmainfo (" PACKAGE_NAME ") " PACKAGE_VERSION);
+ puts("lzmainfo (" PACKAGE_NAME ") " LZMA_VERSION_STRING);
tuklib_exit(EXIT_SUCCESS, EXIT_FAILURE, true);
}
@@ -150,7 +155,7 @@ lzmainfo(const char *name, FILE *f)
lzma_options_lzma *opt = filter.options;
printf("\nDictionary size: "
- "%u MB (2^%u bytes)\n"
+ "%" PRIu32 " MB (2^%" PRIu32 " bytes)\n"
"Literal context bits (lc): %" PRIu32 "\n"
"Literal pos bits (lp): %" PRIu32 "\n"
"Number of pos bits (pb): %" PRIu32 "\n",
@@ -171,6 +176,10 @@ main(int argc, char **argv)
parse_args(argc, argv);
+#ifdef TUKLIB_DOSLIKE
+ setmode(fileno(stdin), O_BINARY);
+#endif
+
int ret = EXIT_SUCCESS;
// We print empty lines around the output only when reading from
OpenPOWER on IntegriCloud