MCPcopy Create free account
hub / github.com/R4be1/PuppetMaster / change_directory

Function change_directory

SSL-shell/shell.c:96–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96bool change_directory(const char *dir)
97{
98 // if they only typed "cd"
99 if (dir == NULL)
100 {
101 // if (SHGetFolderPathA(NULL, CSIDL_PROFILE, NULL, 0, path) == S_OK)
102 // ^ x86_64-w64-mingw32-gcc doesn't like shlobj.h
103 char path[MAX_PATH];
104 if (GetEnvironmentVariableA("USERPROFILE", path, MAX_PATH) > 0)
105 {
106 if (SetCurrentDirectoryA(path))
107 {
108 return true;
109 }
110 }
111 return false;
112 }
113
114 // Change directory - works with relative and absolute
115 if (SetCurrentDirectoryA(dir))
116 {
117 return true;
118 }
119 return false;
120}
121
122#else
123void send_cwd(SSL *ssl)

Callers 1

SSL_shellFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected