From 6a9ad25e443473bdf3acd757b66dfc3e4104544e Mon Sep 17 00:00:00 2001 From: Oleg Kharitonov Date: Mon, 7 Jun 2021 09:13:03 +0200 Subject: [PATCH] Add support for MacOS Mach-O and .dylib files Closes MidnightCommander/mc#164. Signed-off-by: Andrew Borodin --- misc/ext.d/misc.sh.in | 3 +++ misc/mc.ext.ini.in | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/misc/ext.d/misc.sh.in b/misc/ext.d/misc.sh.in index c2644ddf8..822cf2bf6 100644 --- a/misc/ext.d/misc.sh.in +++ b/misc/ext.d/misc.sh.in @@ -35,6 +35,9 @@ do_view_action() { elf) file "${MC_EXT_FILENAME}" && nm -C "${MC_EXT_FILENAME}" ;; + dylib) + file "${MC_EXT_FILENAME}" && nm -n "${MC_EXT_FILENAME}" + ;; dbf) dbview -b "${MC_EXT_FILENAME}" ;; diff --git a/misc/mc.ext.ini.in b/misc/mc.ext.ini.in index c7292ea47..87dc1d2f4 100644 --- a/misc/mc.ext.ini.in +++ b/misc/mc.ext.ini.in @@ -455,6 +455,11 @@ Include=editor Regex=\.(so|so\.[0-9\.]*)$ View=%view{ascii} @EXTHELPERSDIR@/misc.sh view so +# .dylib libraries +[dylib] +Regex=\.(dylib|dylib\.[0-9\.]*)$ +View=%view{ascii} @EXTHELPERSDIR@/misc.sh view dylib + ### Documentation ### @@ -893,6 +898,10 @@ Type=^ELF #Open=%var{PAGER:more} %f View=%view{ascii} @EXTHELPERSDIR@/misc.sh view elf +[Mach-O] +Type=^Mach-O +#Open=%var{PAGER:more} %f +View=%view{ascii} @EXTHELPERSDIR@/misc.sh view dylib ### Documentation ###