]> Sergey Matveev's repositories - nnn.git/commitdiff
Use auto-compress option for bsdtar, tar
authorArun Prakash Jana <engineerarun@gmail.com>
Tue, 6 Aug 2019 17:56:18 +0000 (23:26 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Tue, 6 Aug 2019 17:57:06 +0000 (23:27 +0530)
src/nnn.c

index 7a258567a3cbdb0aa5679c942a9a312c40312098..37e87605eb98459de23b9b78aedffc7541a4ab61 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
 #define EXEC_ARGS_MAX 8
 #define SCROLLOFF 3
 #define LONG_SIZE sizeof(ulong)
-#define ARCHIVE_CMD_LEN 12
+#define ARCHIVE_CMD_LEN 16
 
 /* Program return codes */
 #define _SUCCESS 0
@@ -1265,11 +1265,11 @@ static void get_archive_cmd(char *cmd, char *archive)
        if (getutil(utils[ATOOL]))
                xstrlcpy(cmd, "atool -a", ARCHIVE_CMD_LEN);
        else if (getutil(utils[BSDTAR]))
-               xstrlcpy(cmd, "bsdtar -cvf", ARCHIVE_CMD_LEN);
+               xstrlcpy(cmd, "bsdtar -acvf", ARCHIVE_CMD_LEN);
        else if (is_suffix(archive, ".zip"))
                xstrlcpy(cmd, "zip -r", ARCHIVE_CMD_LEN);
        else
-               xstrlcpy(cmd, "tar -cvf", ARCHIVE_CMD_LEN);
+               xstrlcpy(cmd, "tar -acvf", ARCHIVE_CMD_LEN);
 }
 
 static void archive_selection(const char *cmd, const char *archive, const char *curpath)