mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Fix readline() call sequence
This commit is contained in:
parent
5875358884
commit
afafb7ef8f
14
src/nnn.c
14
src/nnn.c
|
@ -3822,33 +3822,31 @@ nochange:
|
||||||
spawn(shell, "-c", tmp, path, F_CLI);
|
spawn(shell, "-c", tmp, path, F_CLI);
|
||||||
#ifndef NORL
|
#ifndef NORL
|
||||||
} else {
|
} else {
|
||||||
exitcurses();
|
|
||||||
|
|
||||||
/* Switch to current path for readline(3) */
|
/* Switch to current path for readline(3) */
|
||||||
if (chdir(path) == -1) {
|
if (chdir(path) == -1) {
|
||||||
printwarn();
|
printwarn();
|
||||||
goto nochange;
|
goto nochange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exitcurses();
|
||||||
|
|
||||||
tmp = readline("nnn> ");
|
tmp = readline("nnn> ");
|
||||||
|
|
||||||
|
refresh();
|
||||||
|
|
||||||
if (chdir(ipath) == -1) {
|
if (chdir(ipath) == -1) {
|
||||||
printwarn();
|
printwarn();
|
||||||
if (tmp)
|
free(tmp);
|
||||||
free(tmp);
|
|
||||||
goto nochange;
|
goto nochange;
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh();
|
|
||||||
|
|
||||||
if (tmp && tmp[0]) {
|
if (tmp && tmp[0]) {
|
||||||
spawn(shell, "-c", tmp, path, F_CLI);
|
spawn(shell, "-c", tmp, path, F_CLI);
|
||||||
/* readline finishing touches */
|
/* readline finishing touches */
|
||||||
add_history(tmp);
|
add_history(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmp)
|
free(tmp);
|
||||||
free(tmp);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue