From 511b38ce24eb4bd22bec07ec6e27ee299fa3865f Mon Sep 17 00:00:00 2001 From: flachyjoe Date: Sat, 18 Jun 2022 17:41:31 +0200 Subject: [PATCH] [App] Fix file not found error with canonical filename boost::filesystem::canonical doesn't resolve non existent file where boost::filesystem::weakly_canonical does. Notice boost::filesystem::weakly_canonical only resolve absolute path. --- src/App/Document.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 049a550a7e..61ed7e8210 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -2617,9 +2617,9 @@ bool Document::saveToFile(const char* filename) const //realpath is canonical filename i.e. without symlink #ifdef FC_OS_WIN32 QString utf8Name = QString::fromUtf8(filename); - auto realpath = fs::canonical(fs::path(utf8Name.toStdWString())); + auto realpath = fs::weakly_canonical(fs::absolute(fs::path(utf8Name.toStdWString()))); #else - auto realpath = fs::canonical(fs::path(filename)); + auto realpath = fs::weakly_canonical(fs::absolute(fs::path(filename))); #endif // make a tmp. file where to save the project data first and then rename to