aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-04-13 20:48:18 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-04-13 20:48:18 +0530
commitafafb7ef8fa5ea1ade6af39a3dd1d9ab62408889 (patch)
tree91f69bfe93ec3b3ff1640a03346a6df5b07bdfc2 /src/nnn.c
parent58753588848960698ede706894adf99bc410b77d (diff)
downloadnnn-afafb7ef8fa5ea1ade6af39a3dd1d9ab62408889.tar.gz
Fix readline() call sequence
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/nnn.c b/src/nnn.c
index a11d13c..429ee8c 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3822,33 +3822,31 @@ nochange:
spawn(shell, "-c", tmp, path, F_CLI);
#ifndef NORL
} else {
- exitcurses();
-
/* Switch to current path for readline(3) */
if (chdir(path) == -1) {
printwarn();
goto nochange;
}
+ exitcurses();
+
tmp = readline("nnn> ");
+ refresh();
+
if (chdir(ipath) == -1) {
printwarn();
- if (tmp)
- free(tmp);
+ free(tmp);
goto nochange;
}
- refresh();
-
if (tmp && tmp[0]) {
spawn(shell, "-c", tmp, path, F_CLI);
/* readline finishing touches */
add_history(tmp);
}
- if (tmp)
- free(tmp);
+ free(tmp);
}
#endif
}