wendy

inotify based node watcher
git clone git://git.2f30.org/wendy
Log | Files | Refs | README | LICENSE

commit 2c69802f83c5a98433d4253c3fa9bf8eadfb6daa
parent 5d2f4dcb32981d7ff60a82b5b192ad53b2c7cc40
Author: Willy Goiffon <dev@z3bra.org>
Date:   Tue,  2 Jun 2020 10:44:32 +0200

Fix off-by-one error to remove trailing "/"

Diffstat:
Mwendy.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/wendy.c b/wendy.c @@ -88,8 +88,8 @@ watch(int fd, char *pathname, int mask) /* store inode path, eventually removing trailing '/' */ len = strlcpy(w->path, pathname, PATH_MAX); - if (w->path[len - 2] == '/') - w->path[len - 2] == '\0'; + if (w->path[len - 1] == '/') + w->path[len - 1] == '\0'; w->wd = inotify_add_watch(fd, w->path, mask); if (w->wd < 0) {