nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 96cbb4ff84ff6279dcf9735e980130b94a696b30
parent 35aa8645541f2a069949a81faba9f028726765ad
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date:   Sat, 19 Jun 2021 11:15:17 +0530

Fix #1076: show file name in archive extract prompt

Diffstat:
Msrc/nnn.c | 20++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)

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