commit c69067b5026fba18245240601889da3d4da10095
parent 6c197f5f024c9d726de145a19c3fcd66fdb365d1
Author: Arun <engineerarun@gmail.com>
Date: Mon, 20 Jun 2022 21:48:20 +0530
Merge pull request #1406 from N-R-K/realpath
account for realpath failure and update link
Diffstat:
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
@@ -156,7 +156,7 @@ Don't memorize! Arrows, <kbd>/</kbd>, <kbd>q</kbd> suffice. <kbd>Tab</kbd> creat
- [KlzXS](https://github.com/KlzXS)
- [Léo Villeveygoux](https://github.com/leovilok)
- [Luuk van Baal](https://github.com/luukvbaal)
-- [N-R-K](https://github.com/N-R-K)
+- [NRK](https://codeberg.org/NRK)
- [Sijmen J. Mulder](https://github.com/sjmulder)
- and other contributors
diff --git a/src/nnn.c b/src/nnn.c
@@ -6913,13 +6913,11 @@ nochange:
}
pent = &pdents[cur];
- if (g_state.selbm) {
- S_ISLNK(pent->mode)
- ? (realpath(pent->name, newpath) && xstrsncpy(path, lastdir, PATH_MAX))
- : mkpath(path, pent->name, newpath);
- g_state.selbm = 0;
- } else
+ if (!g_state.selbm || !(S_ISLNK(pent->mode) &&
+ realpath(pent->name, newpath) &&
+ xstrsncpy(path, lastdir, PATH_MAX)))
mkpath(path, pent->name, newpath);
+ g_state.selbm = 0;
DPRINTF_S(newpath);
/* Visit directory */