diff options
author | Benji Dial <benji6283@gmail.com> | 2020-09-13 03:19:57 -0400 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2020-09-13 03:19:57 -0400 |
commit | 1e4a254674f668839e5de273916024c16814b045 (patch) | |
tree | 6774f4d4398a29c4aafb4120070975d864ffcde4 /src/user/knob/task.c | |
parent | b8284137d4e0eec11c78bc14047243fce6a51373 (diff) | |
download | portland-os-1e4a254674f668839e5de273916024c16814b045.tar.gz |
(basic, not much tested) keyboard, better panic
Diffstat (limited to 'src/user/knob/task.c')
-rw-r--r-- | src/user/knob/task.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/user/knob/task.c b/src/user/knob/task.c index aa18eab..598bee2 100644 --- a/src/user/knob/task.c +++ b/src/user/knob/task.c @@ -1,11 +1,25 @@ #include <stdbool.h> #include <pland/syscall.h> #include <knob/file.h> +#include <knob/heap.h> +#include <knob/block.h> bool try_run_command(const char *path) { uint8_t dn; path = remove_prefix(path, &dn); - return _start_task(dn, path); + + for (const char *ptr = path; *ptr; ++ptr) + if (*ptr == ' ') { + char *new_path = get_block(ptr - path + 1); + blockcpy(new_path, path, ptr - path); + new_path[ptr - path] = '\0'; + + bool succeded = _start_task(dn, new_path, ptr + 1); + free_block(new_path); + return succeded; + } + + return _start_task(dn, path, ""); } void yield_task() { |