mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 21:36:42 +00:00
Remove unnecessary parameter from archive_selection()
This commit is contained in:
parent
17ed380b57
commit
87627a6e08
10
src/nnn.c
10
src/nnn.c
|
@ -763,7 +763,7 @@ static const char * const patterns[] = {
|
||||||
"%s | tr '\\n' '\\0' | xargs -0 -n2 sh -c '%s \"$0\" \"$@\" < /dev/tty'",
|
"%s | tr '\\n' '\\0' | xargs -0 -n2 sh -c '%s \"$0\" \"$@\" < /dev/tty'",
|
||||||
"\\.(bz|bz2|gz|tar|taz|tbz|tbz2|tgz|z|zip)$", /* Basic formats that don't need external tools */
|
"\\.(bz|bz2|gz|tar|taz|tbz|tbz2|tgz|z|zip)$", /* Basic formats that don't need external tools */
|
||||||
SED" -i 's|^%s\\(.*\\)$|%s\\1|' %s",
|
SED" -i 's|^%s\\(.*\\)$|%s\\1|' %s",
|
||||||
SED" -ze 's|^%s/||' '%s' | xargs -0 %s %s",
|
"xargs -0 %s %s < '%s'",
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Colors */
|
/* Colors */
|
||||||
|
@ -2746,17 +2746,17 @@ static char *get_archive_cmd(const char *archive)
|
||||||
return archive_cmd[i];
|
return archive_cmd[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void archive_selection(const char *cmd, const char *archive, const char *curpath)
|
static void archive_selection(const char *cmd, const char *archive)
|
||||||
{
|
{
|
||||||
char *buf = malloc((xstrlen(patterns[P_ARCHIVE_CMD]) + xstrlen(cmd) + xstrlen(archive)
|
char *buf = malloc((xstrlen(patterns[P_ARCHIVE_CMD]) + xstrlen(cmd) + xstrlen(archive)
|
||||||
+ xstrlen(curpath) + xstrlen(selpath)) * sizeof(char));
|
+ xstrlen(selpath)) * sizeof(char));
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
DPRINTF_S(strerror(errno));
|
DPRINTF_S(strerror(errno));
|
||||||
printwarn(NULL);
|
printwarn(NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(buf, CMD_LEN_MAX, patterns[P_ARCHIVE_CMD], curpath, selpath, cmd, archive);
|
snprintf(buf, CMD_LEN_MAX, patterns[P_ARCHIVE_CMD], cmd, archive, selpath);
|
||||||
spawn(utils[UTIL_SH_EXEC], buf, NULL, NULL, F_CLI | F_CONFIRM);
|
spawn(utils[UTIL_SH_EXEC], buf, NULL, NULL, F_CLI | F_CONFIRM);
|
||||||
free(buf);
|
free(buf);
|
||||||
}
|
}
|
||||||
|
@ -7641,7 +7641,7 @@ nochange:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
(r == 's') ? archive_selection(get_archive_cmd(tmp), tmp, "/")
|
(r == 's') ? archive_selection(get_archive_cmd(tmp), tmp)
|
||||||
: spawn(get_archive_cmd(tmp), tmp, pdents[cur].name,
|
: spawn(get_archive_cmd(tmp), tmp, pdents[cur].name,
|
||||||
NULL, F_CLI | F_CONFIRM);
|
NULL, F_CLI | F_CONFIRM);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue