Replace \ with / slashes in assembly relative paths on *nix.

This is done specifically targeting the case where an assembly
initially made on Windows is transported to an *nix machine.
On *nix, the paths will be already saved with /, and correctly
read on Windows. On Windows however / is not a first-class separator,
in particular it cannot be used in UNC-style paths \\?\ (which
are the only paths that work with Unicode).

See also:
http://msdn.microsoft.com/en-us/library/aa365247.aspx
pull/3/head
whitequark 2015-03-30 03:09:28 +03:00
parent 69c509064c
commit f62e95d7b6
1 changed files with 10 additions and 0 deletions

View File

@ -656,6 +656,16 @@ void SolveSpaceUI::ReloadAllImported(void) {
Group *g = &(SK.group.elem[i]);
if(g->type != Group::IMPORTED) continue;
#ifndef WIN32
// Change backslashes to forward slashes on Unix.
// Done unconditionally to get the displayed filename
// consistent with current filesystem type.
for(int j = 0; j < strlen(g->impFileRel); j++) {
if(g->impFileRel[j] == '\\')
g->impFileRel[j] = '/';
}
#endif
g->impEntity.Clear();
g->impMesh.Clear();
g->impShell.Clear();