summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/vfs/node.cpp')
-rw-r--r--src/kernel/vfs/node.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/kernel/vfs/node.cpp b/src/kernel/vfs/node.cpp
index 08c7817..ea7b531 100644
--- a/src/kernel/vfs/node.cpp
+++ b/src/kernel/vfs/node.cpp
@@ -25,8 +25,10 @@ void vfs_setup() {
root->add_child(".ui", dot_ui);
}
-node* vfs_find(node* root, char* path) {
+node* vfs_find(node* root, char* fn) {
node* el = root;
+ char *path = strdup(fn);
+ char *s = path;
char *member = path;
while (*path != 0 && el != 0) {
@@ -47,6 +49,7 @@ node* vfs_find(node* root, char* path) {
if (el != 0 && member != path) {
el = el->get_child(member);
}
+ kfree(s);
return el;
}