The previous implementation was inconsistent, sometimes it would
inherit the name of the parent folder of the current directory.
Other scenarios i encountered were:
1. Yield a empty search result, and try to edit. It would seemingly
randomly select a file or folder
2. What would happen in a root path without any files residing?
if (ndents)
mkpath(path, dents[cur].name, newpath);
+ else if (sel == SEL_EDIT) /* Avoid trying to edit a non-existing file */
+ goto nochange;
switch (sel) {
case SEL_REDRAW: