diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2019-11-21 00:31:39 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2019-11-21 00:31:39 +0530 |
commit | 2d91768d88b14568139b51da4ce0c85cbe837df5 (patch) | |
tree | 242b41862ac677a3f275a56aa808a136b5722175 /src/nnn.c | |
parent | 0c0f12b5286f1e80b13446c69ebef2ee03ae31ec (diff) | |
download | nnn-2d91768d88b14568139b51da4ce0c85cbe837df5.tar.gz |
Fix some cat abuses in code, plugins
Diffstat (limited to 'src/nnn.c')
-rw-r--r-- | src/nnn.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -891,7 +891,7 @@ static bool listselfile(void) if (!sb.st_size) return FALSE; - snprintf(g_buf, CMD_LEN_MAX, "cat %s | tr \'\\0\' \'\\n\'", g_selpath); + snprintf(g_buf, CMD_LEN_MAX, "tr \'\\0\' \'\\n\' < %s", g_selpath); spawn(utils[SH_EXEC], g_buf, NULL, NULL, F_CLI | F_CONFIRM); return TRUE; @@ -1346,7 +1346,7 @@ static bool cpmv_rename(int choice, const char *path) /* selsafe() returned TRUE for this to be called */ if (!selbufpos) { - snprintf(buf, sizeof(buf), "cat %s | tr '\\0' '\\n' > %s", g_selpath, g_tmpfpath); + snprintf(buf, sizeof(buf), "tr '\\0' '\\n' < %s > %s", g_selpath, g_tmpfpath); spawn(utils[SH_EXEC], buf, NULL, NULL, F_CLI); count = lines_in_file(fd, buf, sizeof(buf)); |