MCPcopy Create free account
hub / github.com/apache/nuttx / host_init_cwd

Function host_init_cwd

arch/sim/src/sim/win/sim_hostmisc.c:66–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64
65#ifdef CONFIG_SIM_IMAGEPATH_AS_CWD
66void host_init_cwd(void)
67{
68 char *name;
69 char path[MAX_PATH];
70
71 /* Get the absolute path of the executable file */
72
73 if (GetModuleFileNameA(GetModuleHandleA(NULL), path, MAX_PATH) == 0)
74 {
75 perror("GetModuleFileNameA failed");
76 return;
77 }
78
79 name = strrchr(path, '/');
80 if (name == NULL)
81 {
82 name = strrchr(path, '\\');
83 }
84
85 *++name = '\0';
86 _chdir(path);
87}
88#endif

Callers 1

up_initializeFunction · 0.50

Calls 2

perrorFunction · 0.85
strrchrFunction · 0.50

Tested by

no test coverage detected