diff options
Diffstat (limited to 'smash/builtin.c')
| -rw-r--r-- | smash/builtin.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/smash/builtin.c b/smash/builtin.c index ad9c839..63a4013 100644 --- a/smash/builtin.c +++ b/smash/builtin.c @@ -3,6 +3,7 @@ #include "../lib/sys/exit.h" #include "../lib/cstr/cstr.h" #include "../lib/sys/io.h" +#include "../lib/sys/chdir.h" u64 __find_builtin_function_by_name(const char *name); @@ -30,7 +31,12 @@ int __builtin_fn_exit(int argc, const char **argv) int __builtin_fn_cd(int argc, const char **argv) { - /* TODO: Implement */ + if (argc != 2) { + write(STDOUT_FD, "path missing\n", 9); + return -1; + } + + return chdir(argv[1]); } int __builtin_fn_help(int argc, const char **argv) |