From: Arun Prakash Jana Date: Sat, 19 Jun 2021 07:30:50 +0000 (+0530) Subject: Do not open current dir in nez context when extracting archive X-Git-Tag: v4.2~72 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=e8f0c532872b85c811a147f842016777ff499e42;p=nnn.git Do not open current dir in nez context when extracting archive --- diff --git a/src/nnn.c b/src/nnn.c index 80bcf0ee..06eef652 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -4291,14 +4291,16 @@ static bool handle_archive(char *fpath /* in-out param */, char op) printwait(messages[MSG_CANCEL], NULL); return FALSE; } - - if (!xmktree(outdir, TRUE) || (chdir(outdir) == -1)) { - printwarn(NULL); - return FALSE; + /* Do not create smart context for current dir */ + if (!(*outdir == '.' && outdir[1] == '\0')) { + 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; } - /* Copy the new dir path to open it in smart context */ - outdir = realpath(".", NULL); - x_to = TRUE; } if (getutil(utils[UTIL_ATOOL])) {