mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 13:51:31 +00:00
Retain a way to return to start dir if file opened
This commit is contained in:
parent
600286b627
commit
16de133fea
|
@ -5904,6 +5904,11 @@ static bool browse(char *ipath, const char *session, int pkey)
|
||||||
lastname = g_ctx[0].c_name; /* last visited filename */
|
lastname = g_ctx[0].c_name; /* last visited filename */
|
||||||
|
|
||||||
xstrsncpy(g_ctx[0].c_path, ipath, PATH_MAX);
|
xstrsncpy(g_ctx[0].c_path, ipath, PATH_MAX);
|
||||||
|
/* If the initial path is a file, retain a way to return to start dir */
|
||||||
|
if (g_state.initfile) {
|
||||||
|
free(initpath);
|
||||||
|
initpath = ipath = getcwd(NULL, 0);
|
||||||
|
}
|
||||||
path = g_ctx[0].c_path; /* current directory */
|
path = g_ctx[0].c_path; /* current directory */
|
||||||
|
|
||||||
g_ctx[0].c_fltr[0] = g_ctx[0].c_fltr[1] = '\0';
|
g_ctx[0].c_fltr[0] = g_ctx[0].c_fltr[1] = '\0';
|
||||||
|
|
Loading…
Reference in a new issue