Unbreak importing files in the same directory as current file.
This commit fixes a bug introduced in commit 0d7aa0a1
.
This commit is contained in:
parent
e78edd9b94
commit
17f7a7b467
25
src/file.cpp
25
src/file.cpp
|
@ -806,17 +806,20 @@ bool SolveSpaceUI::ReloadAllImported(bool canCancel)
|
||||||
g->linkFile = newPath;
|
g->linkFile = newPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string rel = PathSepUNIXToPlatform(g->linkFileRel);
|
// In a newly created group we only have an absolute path.
|
||||||
std::string fromRel = MakePathAbsolute(SS.saveFile, rel);
|
if(!g->linkFileRel.empty()) {
|
||||||
FILE *test = ssfopen(fromRel, "rb");
|
std::string rel = PathSepUNIXToPlatform(g->linkFileRel);
|
||||||
if(test) {
|
std::string fromRel = MakePathAbsolute(SS.saveFile, rel);
|
||||||
fclose(test);
|
FILE *test = ssfopen(fromRel, "rb");
|
||||||
// Okay, exists; update the absolute path.
|
if(test) {
|
||||||
g->linkFile = fromRel;
|
fclose(test);
|
||||||
} else {
|
// Okay, exists; update the absolute path.
|
||||||
// It doesn't exist. Perhaps the file was moved but the tree wasn't, and we
|
g->linkFile = fromRel;
|
||||||
// can use the absolute filename to get us back. The relative path will be
|
} else {
|
||||||
// updated below.
|
// It doesn't exist. Perhaps the file was moved but the tree wasn't, and we
|
||||||
|
// can use the absolute filename to get us back. The relative path will be
|
||||||
|
// updated below.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try_load_file:
|
try_load_file:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user