From: Arun Prakash Jana Date: Sat, 13 Apr 2019 15:18:18 +0000 (+0530) Subject: Fix readline() call sequence X-Git-Tag: v2.5~106 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=afafb7ef8fa5ea1ade6af39a3dd1d9ab62408889;p=nnn.git Fix readline() call sequence --- diff --git a/src/nnn.c b/src/nnn.c index a11d13c6..429ee8cf 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 }