summaryrefslogtreecommitdiff
path: root/kernel/fs/tarfs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fs/tarfs.cpp')
-rw-r--r--kernel/fs/tarfs.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/fs/tarfs.cpp b/kernel/fs/tarfs.cpp
index 706280e..7ab0de5 100644
--- a/kernel/fs/tarfs.cpp
+++ b/kernel/fs/tarfs.cpp
@@ -48,6 +48,8 @@ namespace mercury::kernel::fs {
//len <= 12
char buffer[12];
storage::io_result result = bd->read_bytes(offset, len, buffer);
+ if (result != storage::io_result::success)
+ return result;
out = 0;
for (size_t i = 0; i < len; ++i) {
@@ -134,7 +136,7 @@ namespace mercury::kernel::fs {
char full_name[255];
size_t full_name_len;
- RETURN_MAYBE_NOT_FOUND(read_name(out, full_name, full_name_len))
+ RETURN_MAYBE_NOT_FOUND(read_name(node, full_name, full_name_len))
if (full_name_len + name_len > 255)
return storage::io_result::not_supported;
@@ -150,11 +152,14 @@ namespace mercury::kernel::fs {
size_t cand_name_len;
RETURN_MAYBE_NOT_FOUND(read_name(out, cand_name, cand_name_len))
- if (cand_name_len != full_name_len)
+ if (cand_name_len != full_name_len && cand_name_len != full_name_len + 1)
goto next_iter;
for (size_t i = 0; i < full_name_len; ++i)
if (cand_name[i] != full_name[i])
goto next_iter;
+ if (cand_name_len == full_name_len + 1 &&
+ cand_name[full_name_len] != '/')
+ goto next_iter;
return storage::io_result::success;