X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/59ecf21e36b2332f6adf2a568ef555283d8c119a..1375eb51603466b723ab7dd1ca4194ee5d662f75:/lunaix-os/usr/sh/sh.c?ds=sidebyside diff --git a/lunaix-os/usr/sh/sh.c b/lunaix-os/usr/sh/sh.c index 0a91aa7..4a924db 100644 --- a/lunaix-os/usr/sh/sh.c +++ b/lunaix-os/usr/sh/sh.c @@ -111,7 +111,7 @@ void sh_exec(const char* name, const char** argv) { if (!strcmp(name, "cd")) { - chdir(argv[0]); + chdir(argv[0] ? argv[0] : "."); sh_printerr(); return; } @@ -139,7 +139,7 @@ sh_loop() // stdout (by default, unless user did smth) is the tty we are currently at ioctl(stdout, TIOCSPGRP, getpgid()); - char* argv[] = { 0, 0 }; + char* argv[] = {0, 0}; while (1) { getcwd(pwd, 512);