From 21de4d57d03e04f84625ed49f06f0ea13507983c Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Sun, 13 Sep 2026 21:28:27 -0300
Subject: Ark: handle variable RAR 7 listing widths
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

RAR 7 does not always use the same column widths in the output of
the v command. Some archives are still listed with the older Size
and Packed column widths, so matching the complete separator line
can prevent Ark from detecting the archive contents.

Use the stable trailing part of the separator for RAR 5+ listings,
which works with both observed layouts.

Signed-off-by: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
---
 ark/rar.cpp | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/ark/rar.cpp b/ark/rar.cpp
index c697a863..8ad61eba 100644
--- a/ark/rar.cpp
+++ b/ark/rar.cpp
@@ -60,7 +60,6 @@
 #define VERSION_MINOR   10000
 #define VERSION_PATCH     100
 #define VERSION_5 (5*VERSION_MAJOR - VERSION_PATCH + 1 ) // consider betas
-#define VERSION_7 (7*VERSION_MAJOR - VERSION_PATCH + 1 )
 
 RarArch::RarArch( ArkWidget *_gui, const TQString & _fileName )
   : Arch( _gui, _fileName ), m_isFirstLine(false), m_version(0)
@@ -117,12 +116,10 @@ bool RarArch::processLine( const TQCString &line )
       if (m_version < VERSION_5) {
           m_headerString = "-------------------------------------------------------------------------------";
           m_isFirstLine = true;
-      } else if (m_version < VERSION_7) {
-          // RAR 5 and 6
-          m_headerString = "----------- ---------  -------- ----- ---------- -----  --------  ----";
       } else {
-          // RAR 7+
-          m_headerString = "----------- ---------- ---------- ----- ---------- -----  --------  ----";
+          // RAR 5+ may vary the width of the Size and Packed columns.
+          // Use the stable trailing part of the separator line.
+          m_headerString = "----- ---------- -----  --------  ----";
       }
       setHeaders(); //< Note: header order for version 5 is different, but keep the old one for consistency
       return true;
-- 
cgit v1.2.3

