summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/user/app/shell/builtins.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/user/app/shell/builtins.c b/src/user/app/shell/builtins.c
index 0f0125c..0098773 100644
--- a/src/user/app/shell/builtins.c
+++ b/src/user/app/shell/builtins.c
@@ -234,17 +234,19 @@ static void cmd_touch(int argc, char **argv) {
static void cmd_whitelist(int argc, char **argv) {
int split = 1;
- for (;;) {
- if (split >= argc) {
- eprintf("no command");
- return;
- }
+ for (; split < argc;) {
if (!strcmp("--", argv[split])) break;
split++;
}
argv[split] = NULL;
MOUNT_AT("/") { fs_whitelist((void*)&argv[1]); }
- run_args(argc - split - 1, &argv[split + 1], NULL);
+
+ if (split < argc) {
+ run_args(argc - split - 1, &argv[split + 1], NULL);
+ } else {
+ const char **argv = (const char*[]){"shell", NULL};
+ run_args(1, (void*)argv, NULL);
+ }
}
struct builtin builtins[] = {