mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Remove redundant check
This commit is contained in:
parent
feec63ebb3
commit
4f233c161a
27
src/nnn.c
27
src/nnn.c
|
@ -4515,6 +4515,15 @@ static bool browse(char *ipath, const char *session)
|
||||||
errexit();
|
errexit();
|
||||||
|
|
||||||
begin:
|
begin:
|
||||||
|
/* Can fail when permissions change while browsing.
|
||||||
|
* It's assumed that path IS a directory when we are here.
|
||||||
|
*/
|
||||||
|
if (access(path, R_OK) == -1) {
|
||||||
|
DPRINTF_S("directory inaccessible");
|
||||||
|
find_accessible_parent(path, newpath, lastname, &presel);
|
||||||
|
setdirwatch();
|
||||||
|
}
|
||||||
|
|
||||||
if (cfg.selmode && lastdir[0])
|
if (cfg.selmode && lastdir[0])
|
||||||
lastappendpos = selbufpos;
|
lastappendpos = selbufpos;
|
||||||
|
|
||||||
|
@ -4538,12 +4547,6 @@ begin:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Can fail when permissions change while browsing.
|
|
||||||
* It's assumed that path IS a directory when we are here.
|
|
||||||
*/
|
|
||||||
if (access(path, R_OK) == -1)
|
|
||||||
printwarn(&presel);
|
|
||||||
|
|
||||||
populate(path, lastname);
|
populate(path, lastname);
|
||||||
if (g_states & STATE_INTERRUPTED) {
|
if (g_states & STATE_INTERRUPTED) {
|
||||||
g_states &= ~STATE_INTERRUPTED;
|
g_states &= ~STATE_INTERRUPTED;
|
||||||
|
@ -4581,12 +4584,8 @@ nochange:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If CWD is deleted or moved or perms changed, find an accessible parent */
|
/* If CWD is deleted or moved or perms changed, find an accessible parent */
|
||||||
if (access(path, F_OK)) {
|
if (access(path, F_OK))
|
||||||
DPRINTF_S("directory inaccessible");
|
|
||||||
find_accessible_parent(path, newpath, lastname, &presel);
|
|
||||||
setdirwatch();
|
|
||||||
goto begin;
|
goto begin;
|
||||||
}
|
|
||||||
|
|
||||||
/* If STDIN is no longer a tty (closed) we should exit */
|
/* If STDIN is no longer a tty (closed) we should exit */
|
||||||
if (!isatty(STDIN_FILENO) && !cfg.picker) {
|
if (!isatty(STDIN_FILENO) && !cfg.picker) {
|
||||||
|
@ -6156,12 +6155,6 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
signal(SIGQUIT, SIG_IGN);
|
signal(SIGQUIT, SIG_IGN);
|
||||||
|
|
||||||
/* Test initial path */
|
|
||||||
if (!xdiraccess(initpath)) {
|
|
||||||
xerror();
|
|
||||||
return _FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef NOLOCALE
|
#ifndef NOLOCALE
|
||||||
/* Set locale */
|
/* Set locale */
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
|
|
Loading…
Reference in a new issue