diff --git a/source/fs/mufs/path.c b/source/fs/mufs/path.c index fedc251..8d59ecf 100644 --- a/source/fs/mufs/path.c +++ b/source/fs/mufs/path.c @@ -96,12 +96,15 @@ int mufs_rmpath(struct mufs *fs, const char *path) char data[1 << dev->log2_block_size]; struct mufs_dentry *entry, *next; struct mufs_tree *tree; - char *s; + char *s, *name; uint32_t va, offset, len; if (!(s = mufs_abspath(path))) return -1; + name = strrchr(s, '/'); + *name++ = '\0'; + if (!(tree = resolve_path(fs, s, NULL))) { free(s); return -1;