cex

C/Curses file EXplorer
git clone git://git.wimdupont.com/cex.git
Log | Files | Refs | README | LICENSE

commit 18afe8b33ba2402fcaebf38793d1a39983599636
parent 47367e6f8624effc2735a592094acf41b814f42f
Author: Wim Dupont <wim@wimdupont.com>
Date:   Mon,  6 Apr 2026 18:19:49 +0200

fix symlink check regression

Diffstat:
Mcex.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cex.c b/cex.c @@ -490,7 +490,11 @@ set_win_files(DirWin *dirwin) dirwin->winfiles[count].d_type = ent->d_type; dirwin->winfiles[count].selected = is_selected(dirwin, count); if (ent->d_type == DT_LNK) { - get_fullpath(linkpath, dirwin, count); + if (strcmp(dirwin->path, "/") == 0) + snprintf(linkpath, sizeof(linkpath), "/%s", ent->d_name); + else if (snprintf(linkpath, sizeof(linkpath), "%s/%s", + dirwin->path, ent->d_name) >= (int) sizeof(linkpath)) + linkpath[0] = '\0'; dirwin->winfiles[count].link_valid = (linkpath[0] != '\0' && access(linkpath, F_OK) == 0); } else