diff options
author | 2019-08-14 21:12:17 +0530 | |
---|---|---|
committer | 2019-08-14 21:58:22 +0530 | |
commit | 5c591422dca97671eb23404e8fcde37c09353ed2 (patch) | |
tree | 31be3d57fc72f160ea0330014e830403e0b11d7a | |
parent | 2ffd493162456e478095e3064d5005e29205ea9b (diff) | |
download | nnn-5c591422dca97671eb23404e8fcde37c09353ed2.tar.gz |
Revert "Replaced 'sed' with 'awk'"
This reverts commit 1027cd0cf29a418e0d01f27a9e595c3fd516ec9a.
-rw-r--r-- | src/nnn.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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); } |