From f62e95d7b6f80f0085f3ba1897038902eab59552 Mon Sep 17 00:00:00 2001 From: whitequark Date: Mon, 30 Mar 2015 03:09:28 +0300 Subject: [PATCH] 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 --- src/file.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/file.cpp b/src/file.cpp index f5a9f5f..b06aca5 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -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();