From 516aba1ea0ad7b2bb5f4a161748c6e8846f636c0 Mon Sep 17 00:00:00 2001 From: Martin Cracauer Date: Mon, 6 Feb 2023 16:15:29 -0500 Subject: [PATCH] Fix bug that lead to leading slashes on macOS. --- flist.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flist.c b/flist.c index 34611ba..3c31dc9 100644 --- a/flist.c +++ b/flist.c @@ -962,6 +962,10 @@ flist_gen_dirent(struct sess *sess, char *root, struct flist **fl, size_t *sz, nxdev++; } + /* This is for macOS fts, which returns "foo//bar" */ + if (ent->fts_path[stripdir] == '/') { + stripdir++; + } /* filter files */ if (rules_match(ent->fts_path + stripdir, (ent->fts_info == FTS_D)) == -1) {