Boot loader VFS: fix string termination error.
The code was resetting the pointer to NULL, instead of setting the pointed char to null-terminate the string. The result was resolving the current directory later on, instead of the parent as requested. This only happened when calling open_from with O_CREAT, and a name with sub-directories inside it. The boot loader never does that, so the code wasn't used until now. Fixes #12941. Thanks to mt for spotting the problem.
This commit is contained in:
@@ -1044,7 +1044,7 @@ open_from(Directory *directory, const char *name, int mode, mode_t permissions)
|
|||||||
if (lastSlash[1] == '\0')
|
if (lastSlash[1] == '\0')
|
||||||
return B_ENTRY_NOT_FOUND;
|
return B_ENTRY_NOT_FOUND;
|
||||||
|
|
||||||
lastSlash = '\0';
|
*lastSlash = '\0';
|
||||||
name = lastSlash + 1;
|
name = lastSlash + 1;
|
||||||
|
|
||||||
// resolve the directory
|
// resolve the directory
|
||||||
|
|||||||
Reference in New Issue
Block a user