Revert "Replaced 'sed' with 'awk'"

This reverts commit 1027cd0cf2.
This commit is contained in:
Arun Prakash Jana 2019-08-14 21:12:17 +05:30
parent 2ffd493162
commit 5c591422dc
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 6 additions and 1 deletions

View File

@ -1302,7 +1302,12 @@ 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,
"awk 'BEGIN{RS=\"\\0\"} {gsub(\"%s/\", \"\", $0); printf \"%%s\\0\", $0}' %s | xargs -0 %s %s", curpath, g_cppath, cmd, archive);
#ifdef __linux__
"sed -ze 's|^%s/||' '%s' | xargs -0 %s %s", curpath, g_cppath, cmd, archive);
#else
"cat '%s' | tr '\\0' '\n' | sed -e 's|^%s/||' | tr '\n' '\\0' | xargs -0 %s %s",
g_cppath, curpath, cmd, archive);
#endif
spawn("sh", "-c", buf, curpath, F_NORMAL);
free(buf);
}