Skip to content

Commit

Permalink
Make a duplicate of the environment value (#8703)
Browse files Browse the repository at this point in the history
Fixes #8686
  • Loading branch information
adeas31 committed Mar 15, 2022
1 parent 5715e5c commit ac63367
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions OMCompiler/Compiler/runtime/settingsimpl.c
Expand Up @@ -347,10 +347,8 @@ extern const char* SettingsImpl__getTempDirectoryPath(void)
fprintf(stderr, "Error setting temppath in Kernel\n");
exit(1);
} else {
// Must do replacement in two steps, since the _replace function can not have similar source as target.
char *str = _replace(tempDirectory, (char*)"\\", (char*)"/");
tempDirectoryPath = _replace(str, (char*)"/", (char*)"\\\\");
GC_free(str);
tempDirectoryPath = strdup(tempDirectory);
tempDirectoryPath = covertToForwardSlashesInPlace(tempDirectoryPath);
}
#else
const char* str = getenv("TMPDIR");
Expand Down

0 comments on commit ac63367

Please sign in to comment.