nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 199fb3ca2972e3909969fe0176a7f03daf751481
parent 6481c812bdc094712809894ab5aaa5c371360043
Author: Mischievous Meerkat <engineerarun@gmail.com>
Date:   Sat, 10 Aug 2019 07:06:40 +0530

Merge pull request #313 from 0xACE/relativearchives

Make selection based archives use relative paths
Diffstat:
Msrc/nnn.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/nnn.c b/src/nnn.c @@ -1300,7 +1300,10 @@ 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); +#elif defined __APPLE__ + "cat '%s' | tr '\\0' '\n' | sed -e 's|^%s/||' | tr '\n' '\\0' | xargs -0 %s %s", + g_cppath, curpath, cmd, archive); #else "cat %s | xargs -0 -o %s %s", g_cppath, cmd, archive); #endif