[finsh] Add checking the result of chdir.

This commit is contained in:
bernard 2017-06-15 14:37:56 +08:00
parent bc0fbbfe82
commit 6515dc238c
1 changed files with 4 additions and 1 deletions

View File

@ -189,7 +189,10 @@ int cmd_cd(int argc, char **argv)
} }
else if (argc == 2) else if (argc == 2)
{ {
chdir(argv[1]); if (chdir(argv[1]) != 0)
{
rt_kprintf("No such directory: %s\n", argv[1]);
}
} }
return 0; return 0;