From 47db48f1a848574f31e67cf928eb96dad859a627 Mon Sep 17 00:00:00 2001 From: George Tokmaji Date: Sat, 29 Jun 2024 18:19:22 +0200 Subject: [PATCH] C4Group::View: Reintroduce filename right alignment --- src/C4Group.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/C4Group.cpp b/src/C4Group.cpp index 37bd069aa..b264254d9 100644 --- a/src/C4Group.cpp +++ b/src/C4Group.cpp @@ -1360,6 +1360,7 @@ bool C4Group::View(const char *szFiles) { C4GroupEntry *centry; int fcount = 0, bcount = 0; // Virtual counts + std::size_t maxFilenameLength{0}; if (!StdOutput) return false; @@ -1373,6 +1374,7 @@ bool C4Group::View(const char *szFiles) { fcount++; bcount += centry->Size; + maxFilenameLength = std::max(maxFilenameLength, std::strlen(centry->FileName)); } std::println("Maker: {} Creation: {} {}\n\rVersion: {}.{} CRC: {} ({:X})", @@ -1391,7 +1393,7 @@ bool C4Group::View(const char *szFiles) if (pcoretm) coretm = *pcoretm; else std::print("(invalid timestamp) "); centry->Time = static_cast(cur_time); - std::println("{} {:8} Bytes {:02}.{:02}.{:02} {:02}:{:02}:{:02} {}{:08X} {}", centry->FileName, + std::println("{:>{}} {:8} Bytes {:02}.{:02}.{:02} {:02}:{:02}:{:02} {}{:08X} {}", centry->FileName, maxFilenameLength, centry->Size, coretm.tm_mday, coretm.tm_mon + 1, coretm.tm_year % 100, coretm.tm_hour, coretm.tm_min, coretm.tm_sec,