Fix #1076: show file name in archive extract prompt

This commit is contained in:
Arun Prakash Jana 2021-06-19 11:15:17 +05:30
parent 35aa864554
commit 96cbb4ff84
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -4286,16 +4286,20 @@ static bool handle_archive(char *fpath /* in-out param */, char op)
bool x_to = FALSE; bool x_to = FALSE;
if (op == 'x') { if (op == 'x') {
outdir = xreadline(NULL, messages[MSG_NEW_PATH]); outdir = xreadline(xbasename(fpath), messages[MSG_NEW_PATH]);
if (outdir && *outdir && !(*outdir == '.' && outdir[1] == '\0')) { if (!outdir || !*outdir) { /* Cancelled */
printwait(messages[MSG_CANCEL], NULL);
return FALSE;
}
if (!xmktree(outdir, TRUE) || (chdir(outdir) == -1)) { if (!xmktree(outdir, TRUE) || (chdir(outdir) == -1)) {
printwarn(NULL); printwarn(NULL);
return FALSE; return FALSE;
} }
/* Copy the new dir path to open it in smart context */
outdir = realpath(".", NULL); outdir = realpath(".", NULL);
x_to = TRUE; x_to = TRUE;
} }
}
if (getutil(utils[UTIL_ATOOL])) { if (getutil(utils[UTIL_ATOOL])) {
util = utils[UTIL_ATOOL]; util = utils[UTIL_ATOOL];