Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit a34b659

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Fix for Windows paths in URIs
If a path contains a colon and starts with / (`file:///C:/`), we should return `C:/` and not `/C:/`. Belonging to [master]: - #2546
1 parent 7cd71ba commit a34b659

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

SimulationRuntime/c/simulation/omc_simulation_util.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ extern const char* OpenModelica_parseFmuResourcePath(const char *path)
4848
while (path[0] && path[1]=='/') {
4949
path++;
5050
}
51+
#if defined(__MINGW32__) || defined(_MSC_VER)
52+
if (strchr(path,':')) {
53+
while (path[0]) {
54+
path++;
55+
}
56+
}
57+
#endif
5158
return path;
5259
}
5360
return NULL;

0 commit comments

Comments
 (0)