From 0bccac0711caf8e5b2ca152f2fc1be8302f85363 Mon Sep 17 00:00:00 2001 From: Sean Cunningham Date: Wed, 15 Oct 2025 12:15:56 -0400 Subject: [PATCH] Fix crash on decompress output when reading from stdin. --- cmd/plz4/internal/ops/decompress.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/plz4/internal/ops/decompress.go b/cmd/plz4/internal/ops/decompress.go index 47f7bbb..1044f4d 100644 --- a/cmd/plz4/internal/ops/decompress.go +++ b/cmd/plz4/internal/ops/decompress.go @@ -107,13 +107,18 @@ func _decompress(rdwr *targetT, opts ...plz4.OptT) error { percent := float64(rcnt.cnt) / float64(n) * 100.0 + input := strStdin + if rdwr.src != nil { + input = rdwr.src.Name() + } + t := table.NewWriter() t.SetTitle("Decompress results") t.SetStyle(table.StyleColoredBright) t.SetOutputMirror(os.Stdout) t.AppendHeader(table.Row{"Key", "Value"}) t.AppendRows([]table.Row{ - {"Input", rdwr.src.Name()}, + {"Input", input}, {"Output", rdwr.dst.Name()}, {"InSize", rcnt.cnt}, {"OutSize", n},