summaryrefslogtreecommitdiff
path: root/Source/Kernel/VFS
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Kernel/VFS')
-rw-r--r--Source/Kernel/VFS/DirectoryNode.class.cpp1
-rw-r--r--Source/Kernel/VFS/VFS.ns.cpp4
2 files changed, 4 insertions, 1 deletions
diff --git a/Source/Kernel/VFS/DirectoryNode.class.cpp b/Source/Kernel/VFS/DirectoryNode.class.cpp
index 95d2245..415899c 100644
--- a/Source/Kernel/VFS/DirectoryNode.class.cpp
+++ b/Source/Kernel/VFS/DirectoryNode.class.cpp
@@ -71,6 +71,7 @@ bool DirectoryNode::remove(FSNode* child) {
//Remove node from our children list
m_children[idx] = m_children.back();
m_children.pop();
+ m_length--;
delete child;
diff --git a/Source/Kernel/VFS/VFS.ns.cpp b/Source/Kernel/VFS/VFS.ns.cpp
index 6db791a..30ad2d7 100644
--- a/Source/Kernel/VFS/VFS.ns.cpp
+++ b/Source/Kernel/VFS/VFS.ns.cpp
@@ -40,6 +40,7 @@ FSNode* find(const String& path, FSNode* start) {
}
FSNode* createFile(const String& path, FSNode* start) {
+ if (find(path, start) != NULL) return NULL; //Something already has that name.
if (start == 0) start = rootNode;
Vector<String> p = path.split("/");
@@ -71,6 +72,7 @@ FSNode* createFile(const String& path, FSNode* start) {
}
FSNode* createDirectory(const String& path, FSNode* start) {
+ if (find(path, start) != NULL) return NULL; //Something already has that name.
if (start == 0) start = rootNode;
Vector<String> p = path.split("/");
@@ -102,7 +104,7 @@ FSNode* createDirectory(const String& path, FSNode* start) {
}
bool remove(const String& path, FSNode* start) {
- FSNode* node =find(path, start);
+ FSNode* node = find(path, start);
if (node == NULL) return false;
FSNode* parent = node->getParent();
if (parent == NULL) return false;