MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / LShBuiltin_Cd

Function LShBuiltin_Cd

Applications/LSh/main.cpp:32–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30std::list<builtin_t> builtins;
31
32void LShBuiltin_Cd(int argc, char** argv){
33 if(argc > 3){
34 printf("cd: Too many arguments");
35 } else if (argc == 2){
36 if(chdir(argv[1])){
37 printf("cd: Error changing working directory to %s\n", argv[1]);
38 }
39 } else chdir("/");
40
41 getcwd(currentDir, PATH_MAX);
42}
43
44void LShBuiltin_Pwd(int argc, char** argv){
45 getcwd(currentDir, PATH_MAX);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected