diff options
author | Mischievous Meerkat <engineerarun@gmail.com> | 2019-08-10 07:06:40 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-10 07:06:40 +0530 |
commit | 199fb3ca2972e3909969fe0176a7f03daf751481 (patch) | |
tree | 26daaed1e612ecd95a62b0748ceaf19c41f7c5c8 /src | |
parent | 6481c812bdc094712809894ab5aaa5c371360043 (diff) | |
parent | 2baa42b877ca0bc338a1852397ca3a0aa7c30b79 (diff) | |
download | nnn-199fb3ca2972e3909969fe0176a7f03daf751481.tar.gz |
Merge pull request #313 from 0xACE/relativearchives
Make selection based archives use relative paths
Diffstat (limited to 'src')
-rw-r--r-- | src/nnn.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |