From f161d19038c9953d9fee9643d2d6190a0df2afef Mon Sep 17 00:00:00 2001 From: Andrey Shcheglov Date: Sat, 19 May 2018 00:10:13 +0300 Subject: [PATCH] mc.ext: allow Java class files to be viewed even if JAD isn't on PATH Closes MidnightCommander/mc#134: * `file -b` prints class file version, which `javap` doesn't by default * `javap`'s stderr should be suppressed as it may print `_JAVA_OPTIONS` if this variable is set Signed-off-by: Yury V. Zaytsev --- misc/ext.d/misc.sh.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/ext.d/misc.sh.in b/misc/ext.d/misc.sh.in index e76025ead..ee36384f2 100644 --- a/misc/ext.d/misc.sh.in +++ b/misc/ext.d/misc.sh.in @@ -48,7 +48,8 @@ do_view_action() { ctorrent -x "${MC_EXT_FILENAME}" 2>/dev/null ;; javaclass) - jad -p "${MC_EXT_FILENAME}" 2>/dev/null + jad -p "${MC_EXT_FILENAME}" 2>/dev/null || \ + (file -b "${MC_EXT_FILENAME}"; javap -private "${MC_EXT_FILENAME}" 2>/dev/null) ;; *) ;;