aboutsummaryrefslogtreecommitdiff
path: root/src/xz/file_io.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2022-11-09 14:10:52 +0200
committerLasse Collin <lasse.collin@tukaani.org>2022-11-09 14:10:52 +0200
commit724285dadbdc88765c8fb83eab9816575a260966 (patch)
tree2026a103a5a733580604290f8ec633a7d18e7e74 /src/xz/file_io.c
parentxz: Fix displaying of file sizes in progress indicator in passthru mode. (diff)
downloadxz-724285dadbdc88765c8fb83eab9816575a260966.tar.xz
xz: Add comments about stdin and src_st.st_size.
"xz -v < regular_file > out.xz" doesn't display the percentage and estimated remaining time because it doesn't even try to check the input file size when input is read from stdin. This could be improved but for now there's just a comment to remind about it.
Diffstat (limited to '')
-rw-r--r--src/xz/file_io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xz/file_io.c b/src/xz/file_io.c
index 61857029..a5841b37 100644
--- a/src/xz/file_io.c
+++ b/src/xz/file_io.c
@@ -768,6 +768,10 @@ io_open_src(const char *src_name)
// a statically allocated structure.
static file_pair pair;
+ // This implicitly also initializes src_st.st_size to zero
+ // which is expected to be <= 0 by default. fstat() isn't
+ // called when reading from standard input but src_st.st_size
+ // is still read.
pair = (file_pair){
.src_name = src_name,
.dest_name = NULL,