]> Sergey Matveev's repositories - nnn.git/commitdiff
Make selection based archives use relative paths
author0xACE <0xaced@gmail.com>
Sat, 3 Aug 2019 22:41:20 +0000 (00:41 +0200)
committer0xACE <0xaced@gmail.com>
Sat, 3 Aug 2019 22:41:20 +0000 (00:41 +0200)
This will create archives relative to your current working directory
rather than a full path when when creating the archive based on your
current selection.

src/nnn.c

index 874b2052a8d6c89934676fb77ca8f372eaf45a41..1b3557e256e53a9cb143096a2dc39b3513b355b2 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1302,7 +1302,7 @@ static void archive_selection(const char *cmd, const char *archive, const char *
        char *buf = (char *)malloc(CMD_LEN_MAX * sizeof(char));
        snprintf(buf, CMD_LEN_MAX,
 #ifdef __linux__
-                "xargs -0 -a %s %s %s", g_cppath, cmd, archive);
+               "sed -ze 's|^%s/||' '%s' | xargs -0 %s %s", curpath, g_cppath, cmd, archive);
 #else
                 "cat %s | xargs -0 -o %s %s", g_cppath, cmd, archive);
 #endif