diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-12-30 14:49:46 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-01-19 14:41:55 -0500 |
commit | 683552c4c9a3dfee4ce603157bb2cf18d64fbcfc (patch) | |
tree | 475130eeb136007eea7c59cb7190dc05287e2c56 /src/mtab.c | |
parent | 944cd72f40a84d318453c320a84d443273956859 (diff) | |
download | bfs-683552c4c9a3dfee4ce603157bb2cf18d64fbcfc.tar.xz |
bfstd: New wrappers for dirname()/basename()
Diffstat (limited to 'src/mtab.c')
-rw-r--r-- | src/mtab.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -86,7 +86,8 @@ static int bfs_mtab_add(struct bfs_mtab *mtab, const char *path, const char *typ goto fail_entry; } - if (!trie_insert_str(&mtab->names, xbasename(path))) { + const char *name = path + xbaseoff(path); + if (!trie_insert_str(&mtab->names, name)) { goto fail; } @@ -223,7 +224,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 = xbasename(path); + const char *name = path + xbaseoff(path); return trie_find_str(&mtab->names, name); } |