mirror of
https://github.com/jarun/nnn.git
synced 2024-12-01 02:49:44 +00:00
Default to CWD for atool
This commit is contained in:
parent
e8f0c53287
commit
17bb0cfb52
14
src/nnn.c
14
src/nnn.c
|
@ -4282,11 +4282,12 @@ next:
|
||||||
static bool handle_archive(char *fpath /* in-out param */, char op)
|
static bool handle_archive(char *fpath /* in-out param */, char op)
|
||||||
{
|
{
|
||||||
char arg[] = "-tvf"; /* options for tar/bsdtar to list files */
|
char arg[] = "-tvf"; /* options for tar/bsdtar to list files */
|
||||||
char *util, *outdir;
|
char *util, *outdir = NULL;
|
||||||
bool x_to = FALSE;
|
bool x_to = FALSE;
|
||||||
|
bool is_atool = getutil(utils[UTIL_ATOOL]);
|
||||||
|
|
||||||
if (op == 'x') {
|
if (op == 'x') {
|
||||||
outdir = xreadline(xbasename(fpath), messages[MSG_NEW_PATH]);
|
outdir = xreadline(is_atool ? "." : xbasename(fpath), messages[MSG_NEW_PATH]);
|
||||||
if (!outdir || !*outdir) { /* Cancelled */
|
if (!outdir || !*outdir) { /* Cancelled */
|
||||||
printwait(messages[MSG_CANCEL], NULL);
|
printwait(messages[MSG_CANCEL], NULL);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -4303,7 +4304,7 @@ static bool handle_archive(char *fpath /* in-out param */, char op)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getutil(utils[UTIL_ATOOL])) {
|
if (is_atool) {
|
||||||
util = utils[UTIL_ATOOL];
|
util = utils[UTIL_ATOOL];
|
||||||
arg[1] = op;
|
arg[1] = op;
|
||||||
arg[2] = '\0';
|
arg[2] = '\0';
|
||||||
|
@ -4332,8 +4333,8 @@ static bool handle_archive(char *fpath /* in-out param */, char op)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
xstrsncpy(fpath, outdir, PATH_MAX);
|
xstrsncpy(fpath, outdir, PATH_MAX);
|
||||||
free(outdir);
|
} else if (op == 'x')
|
||||||
}
|
fpath[0] = '\0';
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -6540,7 +6541,10 @@ nochange:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r == 'x' || r == 'm') {
|
if (r == 'x' || r == 'm') {
|
||||||
|
if (newpath[0])
|
||||||
set_smart_ctx('+', newpath, &path, &lastname, &lastdir);
|
set_smart_ctx('+', newpath, &path, &lastname, &lastdir);
|
||||||
|
else
|
||||||
|
copycurname();
|
||||||
clearfilter();
|
clearfilter();
|
||||||
goto begin;
|
goto begin;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue