Merge pull request #313 from 0xACE/relativearchives

Make selection based archives use relative paths
This commit is contained in:
Mischievous Meerkat 2019-08-10 07:06:40 +05:30 committed by GitHub
commit 199fb3ca29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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