mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-30 00:08:03 +00:00
Refactor node creation logic
This commit is contained in:
parent
0d2036139c
commit
42225a5cd9
@ -140,10 +140,9 @@ namespace vfs
|
|||||||
this->Parent->Children.push_back(this);
|
this->Parent->Children.push_back(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Parent)
|
if (NoParent)
|
||||||
CreateWithParent(Name, Parent);
|
|
||||||
else if (NoParent)
|
|
||||||
{
|
{
|
||||||
|
Parent = nullptr;
|
||||||
const char *Path = Name;
|
const char *Path = Name;
|
||||||
|
|
||||||
Node *RootNode = fs->FileSystemRoot->Children[0];
|
Node *RootNode = fs->FileSystemRoot->Children[0];
|
||||||
@ -211,6 +210,8 @@ namespace vfs
|
|||||||
delete[] SegmentName;
|
delete[] SegmentName;
|
||||||
} while (cwk_path_get_next_segment(&segment));
|
} while (cwk_path_get_next_segment(&segment));
|
||||||
}
|
}
|
||||||
|
else if (Parent)
|
||||||
|
CreateWithParent(Name, Parent);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->Name = new char[strlen(Name) + 1];
|
this->Name = new char[strlen(Name) + 1];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user