sfm

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

commit 93746251ae2233031c52d730fb4e0632194bc601
parent 26e53f038047df7ed3a420b7783d75757d55a3ac
Author: afify <hassan@afify.dev>
Date:   Wed, 14 Oct 2020 16:41:17 +0300

[fix] empty dir fs watch

- problem: listdir() return if current dir is empty before adding watch
- solution: move addwatch() before empty dir return

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

diff --git a/sfm.c b/sfm.c @@ -1579,6 +1579,9 @@ listdir(int hi, char *filter) cpane->dircol.fg |= TB_BOLD; printf_tb(cpane->dirx, 0, cpane->dircol, " %.*s ", width, cpane->dirn); + if (addwatch() < 0) + print_error("can't add watch"); + /* empty directory */ if (cpane->dirc == 0) { clear_status(); @@ -1624,8 +1627,6 @@ listdir(int hi, char *filter) } } - if (addwatch() < 0) - print_error("can't add watch"); cpane->dirc = i; qsort(cpane->direntr, cpane->dirc, sizeof(Entry), sort_name); refresh_pane();