From afbdeeaeee9cf4a9fe99c5b53ca9dc0ce6580911 Mon Sep 17 00:00:00 2001 From: Gerard Bosch <30733556+gerardbosch@users.noreply.github.com> Date: Thu, 6 Nov 2025 22:45:35 +0100 Subject: [PATCH] Ticket #4861: add extension-based fallbacks for JAR and WAR files to mc.ext Detection for JAR files in the `file` command apparently is flaky and behaves inconsistently between Linux distributions. On top of that, as of yet, there aren't any provisions for detecting WAR files, so those can only be supported by an extension match at this point. Signed-off-by: Gerard Bosch <30733556+gerardbosch@users.noreply.github.com> Signed-off-by: Yury V. Zaytsev --- misc/mc.ext.ini.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/misc/mc.ext.ini.in b/misc/mc.ext.ini.in index ef2477ff2..88eaba8c2 100644 --- a/misc/mc.ext.ini.in +++ b/misc/mc.ext.ini.in @@ -1159,12 +1159,18 @@ Type=\\(Zip archive Open=%cd %p/uzip:// View=%view{ascii} @EXTHELPERSDIR@/archive.sh view zip -[jar] +[jar-war-by-type] Type=\\(Java (Jar file|archive) data \\((zip|JAR)\\)\\) TypeIgnoreCase=true Open=%cd %p/uzip:// View=%view{ascii} @EXTHELPERSDIR@/archive.sh view zip +[jar-war-by-regex] +Regex=\\.[jw]ar$ +RegexIgnoreCase=true +Open=%cd %p/uzip:// +View=%view{ascii} @EXTHELPERSDIR@/archive.sh view zip + [apk] Type=Android package \\(APK\\) TypeIgnoreCase=true