mufs: get parent directory in mufs_rmpath() to remove the directory entry from

This commit is contained in:
S.J.R. van Schaik 2017-06-12 16:16:22 +02:00
parent 6492a76d14
commit 704cd24061

View file

@ -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;