summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bftw.c2
-rw-r--r--src/mtab.c3
-rw-r--r--src/mtab.h6
3 files changed, 5 insertions, 6 deletions
diff --git a/src/bftw.c b/src/bftw.c
index debf92c..d392aed 100644
--- a/src/bftw.c
+++ b/src/bftw.c
@@ -1390,7 +1390,7 @@ static bool bftw_need_stat(const struct bftw_state *state) {
// need to stat() to get the correct type. We don't need to
// check for directories because they can only be mounted over
// by other directories.
- if (bfs_might_be_mount(state->mtab, ftwbuf->path)) {
+ if (bfs_might_be_mount(state->mtab, ftwbuf->path + ftwbuf->nameoff)) {
return true;
}
#endif
diff --git a/src/mtab.c b/src/mtab.c
index cc726a2..c76f403 100644
--- a/src/mtab.c
+++ b/src/mtab.c
@@ -271,8 +271,7 @@ const char *bfs_fstype(const struct bfs_mtab *mtab, const struct bfs_stat *statb
}
}
-bool bfs_might_be_mount(const struct bfs_mtab *mtab, const char *path) {
- const char *name = path + xbaseoff(path);
+bool bfs_might_be_mount(const struct bfs_mtab *mtab, const char *name) {
return trie_find_str(&mtab->names, name);
}
diff --git a/src/mtab.h b/src/mtab.h
index ca4372c..d99d78f 100644
--- a/src/mtab.h
+++ b/src/mtab.h
@@ -43,12 +43,12 @@ const char *bfs_fstype(const struct bfs_mtab *mtab, const struct bfs_stat *statb
*
* @param mtab
* The current mount table.
- * @param path
- * The path to check.
+ * @param name
+ * The name of the file to check.
* @return
* Whether the named file could be a mount point.
*/
-bool bfs_might_be_mount(const struct bfs_mtab *mtab, const char *path);
+bool bfs_might_be_mount(const struct bfs_mtab *mtab, const char *name);
/**
* Free a mount table.