mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 21:36:42 +00:00
account for realpath failure
realpath may fail, in which case fallback to mkpath.
This commit is contained in:
parent
6c197f5f02
commit
eb66cb5d11
10
src/nnn.c
10
src/nnn.c
|
@ -6913,13 +6913,11 @@ nochange:
|
||||||
}
|
}
|
||||||
|
|
||||||
pent = &pdents[cur];
|
pent = &pdents[cur];
|
||||||
if (g_state.selbm) {
|
if (!g_state.selbm || !(S_ISLNK(pent->mode) &&
|
||||||
S_ISLNK(pent->mode)
|
realpath(pent->name, newpath) &&
|
||||||
? (realpath(pent->name, newpath) && xstrsncpy(path, lastdir, PATH_MAX))
|
xstrsncpy(path, lastdir, PATH_MAX)))
|
||||||
: mkpath(path, pent->name, newpath);
|
|
||||||
g_state.selbm = 0;
|
|
||||||
} else
|
|
||||||
mkpath(path, pent->name, newpath);
|
mkpath(path, pent->name, newpath);
|
||||||
|
g_state.selbm = 0;
|
||||||
DPRINTF_S(newpath);
|
DPRINTF_S(newpath);
|
||||||
|
|
||||||
/* Visit directory */
|
/* Visit directory */
|
||||||
|
|
Loading…
Reference in a new issue