X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/2a49908006b177c4d6354309333d06b1b96e4887..1375eb51603466b723ab7dd1ca4194ee5d662f75:/lunaix-os/usr/sh/sh.c diff --git a/lunaix-os/usr/sh/sh.c b/lunaix-os/usr/sh/sh.c index 8ce8617..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); @@ -175,7 +175,6 @@ sh_loop() void main() { - printf("\n Simple shell. Use or to scroll.\n\n"); sh_loop(); _exit(0); } \ No newline at end of file