mufs: split path properly in mufs_mkpath()
This commit is contained in:
parent
a65cdbfedf
commit
92a531b49f
1 changed files with 4 additions and 5 deletions
|
@ -33,12 +33,11 @@ int mufs_mkpath(struct mufs *fs, const char *path, unsigned type)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (!(name = strrchr(s, '/'))) {
|
||||
name = s;
|
||||
name = strrchr(s, '/');
|
||||
*name++ = '\0';
|
||||
|
||||
if (*s == '\0')
|
||||
s = "/";
|
||||
} else {
|
||||
*name++ = '\0';
|
||||
}
|
||||
|
||||
if (*name == '\0')
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Reference in a new issue