瀏覽代碼

Revert "Replaced 'sed' with 'awk'"

This reverts commit 1027cd0cf2.
master
Arun Prakash Jana 6 年之前
父節點
當前提交
5c591422dc
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: A75979F35C080412
共有 1 個檔案被更改,包括 6 行新增1 行删除
  1. +6
    -1
      src/nnn.c

+ 6
- 1
src/nnn.c 查看文件

@@ -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);
}


Loading…
取消
儲存