mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
Shell: Validate only one directory is given to cd
This commit is contained in:
parent
d0fb816ac3
commit
0de2ead0e9
Notes:
sideshowbarker
2024-07-19 08:48:46 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/0de2ead0e91 Pull-request: https://github.com/SerenityOS/serenity/pull/1279 Issue: https://github.com/SerenityOS/serenity/issues/397 Reviewed-by: https://github.com/awesomekling
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
Reference in a new issue