mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 19:55:06 +00:00
Shell: Validate only one directory is given to cd
This commit is contained in:
parent
d0fb816ac3
commit
0de2ead0e9
1 changed files with 5 additions and 0 deletions
|
@ -187,6 +187,11 @@ static String expand_tilde(const char* expression)
|
|||
|
||||
static int sh_cd(int argc, const char** argv)
|
||||
{
|
||||
if (argc > 2) {
|
||||
fprintf(stderr, "cd: too many arguments\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
String new_path;
|
||||
|
||||
if (argc == 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue