feat: capability list to enable greater flexibility of devices
[lunaix-os.git] / lunaix-os / usr / sh / sh.c
index 0a91aa79179ebe95ef426653a2b315b4743837dd..2c9bb8d1ec7fa2f5bb93198ab37e4280ff98ba35 100644 (file)
@@ -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,11 +139,11 @@ 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);
-        printf("[\033[2m%s\033[39;49m]$ ", pwd);
+        printf("[%s]$ ", pwd);
         int sz = read(stdin, buf, 511);
 
         if (sz < 0) {