]> Sergey Matveev's repositories - nnn.git/commitdiff
Revert "Archive handling on OS X using unar+lsar"
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 27 Sep 2017 16:37:04 +0000 (22:07 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 27 Sep 2017 16:44:09 +0000 (22:14 +0530)
This reverts commit 1e859eb1370bd67cecd06b7bc8c6f885b80554bd.
We will use atool on OS X as well, it can be brewed easily.

nnn.c
nnn.h

diff --git a/nnn.c b/nnn.c
index 21c16ec406a7cfe25d30314a52c62a86d227ff20..e7318d0a40a26efb5b8feb1015e046c79f6d0d82 100644 (file)
--- a/nnn.c
+++ b/nnn.c
@@ -252,12 +252,7 @@ static char * const utils[] = {
        "/usr/bin/xdg-open",
 #endif
        "nlay",
-#ifdef __APPLE__
-       "unar",
-       "lsar"
-#else
        "atool"
-#endif
 };
 
 /* Common message strings */
@@ -1634,21 +1629,6 @@ show_mediainfo(char *fpath, char *arg)
 static int
 handle_archive(char *fpath, char *arg, char *dir)
 {
-#ifdef __APPLE__
-       if (arg[1] == 'x') {
-               if (!get_output(g_buf, MAX_CMD_LEN, "which", utils[4], NULL, 0))
-                       return -1;
-
-               spawn(utils[4], fpath, NULL, dir, F_NORMAL);
-       } else {
-               if (!get_output(g_buf, MAX_CMD_LEN, "which", utils[5], NULL, 0))
-                       return -1;
-
-               exitcurses();
-               get_output(NULL, 0, utils[5], fpath, NULL, 1);
-               initcurses();
-       }
-#else
        if (!get_output(g_buf, MAX_CMD_LEN, "which", utils[4], NULL, 0))
                return -1;
 
@@ -1659,7 +1639,6 @@ handle_archive(char *fpath, char *arg, char *dir)
                get_output(NULL, 0, utils[4], arg, fpath, 1);
                initcurses();
        }
-#endif
 
        return 0;
 }
@@ -2606,14 +2585,8 @@ nochange:
                                if (r == -1) {
                                        if (sel == SEL_MEDIA || sel == SEL_FMEDIA)
                                                sprintf(g_buf, "%s missing", utils[cfg.metaviewer]);
-                                       else {
-#ifdef __APPLE__
-                                               if (sel == SEL_LIST)
-                                                       sprintf(g_buf, "%s missing", utils[5]);
-                                               else
-#endif
-                                                       sprintf(g_buf, "%s missing", utils[4]);
-                                       }
+                                       else
+                                               sprintf(g_buf, "%s missing", utils[4]);
 
                                        printmsg(g_buf);
                                        goto nochange;
diff --git a/nnn.h b/nnn.h
index a298b067955fe63d73297eeddb41e8c4c0402a86..020cb14bf1c4237603fa1ba2f0c8dc154997eb63 100644 (file)
--- a/nnn.h
+++ b/nnn.h
@@ -134,9 +134,9 @@ static struct key bindings[] = {
        /* Open dir in desktop file manager */
        { 'o',            SEL_DFB,       "",     "" },
        /* List archive */
-       { 'f',            SEL_LIST,      "-l",   "" },
+       { 'f',            SEL_LIST,      "-l", "" },
        /* Extract archive */
-       { CONTROL('X'),   SEL_EXTRACT,   "-x",   "" },
+       { CONTROL('X'),   SEL_EXTRACT,   "-x", "" },
        /* Toggle sort by size */
        { 's',            SEL_FSIZE,     "",     "" },
        /* Sort by total block count including dir contents */