sfm

simple file manager
git clone git://git.afify.dev/sfm
Log | Files | Refs | README | LICENSE

commit b4e5238b89196c65487ce261920dff322fd810b3
parent b9d026726544ac0e95e942f61b5aa10b16deb0a7
Author: afify <hassan@afify.dev>
Date:   Sat, 10 Apr 2021 03:27:29 +0300

[ref] print_row() S_ISLNK

- split conditions for readability

Diffstat:
Msfm.c | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/sfm.c b/sfm.c @@ -278,11 +278,12 @@ print_row(Pane *pane, size_t entpos, Cpair col) x = pane->dirx; y = entpos - cpane->firstrow + 1; - if (S_ISLNK(pane->direntr[entpos].mode) && - realpath(pane->direntr[entpos].name, buf) != NULL) { - (void)snprintf(lnk_full, MAX_N, "%s -> %s", - result, buf); - result = lnk_full; + if (S_ISLNK(pane->direntr[entpos].mode) != 0) { + if (realpath(pane->direntr[entpos].name, buf) != NULL) { + (void)snprintf(lnk_full, MAX_N, + "%s -> %s", result, buf); + result = lnk_full; + } } printf_tb(x, y, col, "%*.*s", ~width, width, result);