MCPcopy Create free account
hub / github.com/NetHack/NetHack / build_environment_path

Function build_environment_path

sys/windows/windsys.c:978–1004  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

976}
977
978void
979build_environment_path(const char *env_str, const char *folder, char *path,
980 size_t path_size)
981{
982 path[0] = '\0';
983
984 const char *root_path = nh_getenv(env_str);
985
986 if (root_path == NULL)
987 return;
988
989 strcpy_s(path, path_size, root_path);
990
991 char *colon = strchr(path, ';');
992 if (colon != NULL)
993 path[0] = '\0';
994
995 if (strlen(path) == 0)
996 return;
997
998 append_slash(path);
999
1000 if (folder != NULL) {
1001 strcat_s(path, path_size, folder);
1002 strcat_s(path, path_size, "\\");
1003 }
1004}
1005
1006boolean
1007folder_file_exists(const char *folder, const char *file_name)

Callers

nothing calls this directly

Calls 2

append_slashFunction · 0.70
nh_getenvFunction · 0.50

Tested by

no test coverage detected