Skip to content

Commit

Permalink
Fix bug that lead to leading slashes on macOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
cracauer authored and kevans91 committed Nov 17, 2023
1 parent 01edfe6 commit e0b90bc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions flist.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,17 @@ flist_gen_dirent(struct sess *sess, char *root, struct flist **fl, size_t *sz,
nxdev++;
}

#ifdef __APPLE__
/*
* This is for macOS fts, which returns "foo//bar" -- we only
* strip up to the first slash, which naturally ends up
* interpreted as an absolute path.
*/
if (ent->fts_path[stripdir] == '/') {
stripdir++;
}
#endif

/* filter files */
if (rules_match(ent->fts_path + stripdir,
(ent->fts_info == FTS_D)) == -1) {
Expand Down

0 comments on commit e0b90bc

Please sign in to comment.