summaryrefslogtreecommitdiff
path: root/src/user/knob/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/knob/file.c')
-rw-r--r--src/user/knob/file.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/user/knob/file.c b/src/user/knob/file.c
index f1a039d..3083503 100644
--- a/src/user/knob/file.c
+++ b/src/user/knob/file.c
@@ -1,8 +1,9 @@
-#include <pland/syscall.h>
-#include <pland/pcrt.h>
#include <knob/format.h>
+#include <knob/panic.h>
#include <knob/heap.h>
-#include <knob/env.h>
+
+#include <pland/syscall.h>
+#include <pland/pcrt.h>
struct ofl_node {
struct ofl_node *next;
@@ -27,23 +28,10 @@ struct file {
};
const char *remove_prefix(const char *path, uint8_t *dn_out) {
- if ((path[0] != 's') || (path[1] != 'd'))
- goto no_prefix;
-
- const char *num_part = path + 2;
- for (uint32_t i = 0; num_part[i]; ++i)
- if (num_part[i] == ':') {
-
- uint32_t dn_large;
- if (!try_sntoi(num_part, i, &dn_large) || dn_large > 255)
- goto no_prefix;
-
- *dn_out = (uint8_t)dn_large;
- return num_part + i + 1;
- }
+ if ((path[0] == 's') && (path[1] == 'd'))
+ PANIC("remove_prefix not fully implemented");
-no_prefix:
- *dn_out = current_drive;
+ *dn_out = 0;//change this later to an "active drive" or something
return path;
}