mirror of
https://github.com/jarun/nnn.git
synced 2025-01-09 17:39:38 +00:00
Fix #301 - use local buffer to avoid overwriting g_buf
This commit is contained in:
parent
2a4008c9ab
commit
8fe4761092
|
@ -1265,14 +1265,16 @@ finish:
|
|||
|
||||
static void archive_selection(const char *cmd, const char *archive, const char *curpath)
|
||||
{
|
||||
snprintf(g_buf, CMD_LEN_MAX,
|
||||
char *buf = (char *)malloc(CMD_LEN_MAX * sizeof(char));
|
||||
snprintf(buf, CMD_LEN_MAX,
|
||||
#ifdef __linux__
|
||||
"xargs -0 -a %s %s %s",
|
||||
#else
|
||||
"cat %s | xargs -0 -o %s %s",
|
||||
#endif
|
||||
g_cppath, cmd, archive);
|
||||
spawn("sh", "-c", g_buf, curpath, F_NORMAL);
|
||||
spawn("sh", "-c", buf, curpath, F_NORMAL);
|
||||
free(buf);
|
||||
}
|
||||
|
||||
static bool write_lastdir(const char *curpath)
|
||||
|
|
Loading…
Reference in a new issue