From 288dbfd0d8940e399cf45bbb59aac44bbb444041 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Sat, 21 Nov 2020 11:43:48 +0100 Subject: [PATCH] fixed typo in comment & formatting --- src/slic3r/GUI/InstanceCheck.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/slic3r/GUI/InstanceCheck.cpp b/src/slic3r/GUI/InstanceCheck.cpp index 8067fc7f32..aaf3ba3c66 100644 --- a/src/slic3r/GUI/InstanceCheck.cpp +++ b/src/slic3r/GUI/InstanceCheck.cpp @@ -259,16 +259,15 @@ bool instance_check(int argc, char** argv, bool app_config_single_instance) std::hash{}(boost::filesystem::system_complete(argv[0]).string()); #else std::hash{}(boost::filesystem::canonical(boost::filesystem::system_complete(argv[0]), ec).string()); - if(ec.value() > 0) { // canonical was not able to find execitable (can happen with appimage on some systems) - ec.clear(); - // Compose path with boost canonical of folder and filename - hashed_path = std::hash{}(boost::filesystem::canonical(boost::filesystem::system_complete(argv[0]).parent_path(), ec).string() + "/" + boost::filesystem::system_complete(argv[0]).filename().string()); - if(ec.value() > 0) { - // Still not valid, process without canonical - hashed_path = std::hash{}(boost::filesystem::system_complete(argv[0]).string()); - - } + if (ec.value() > 0) { // canonical was not able to find the executable (can happen with appimage on some systems. Does it fail on Fuse file systems?) + ec.clear(); + // Compose path with boost canonical of folder and filename + hashed_path = std::hash{}(boost::filesystem::canonical(boost::filesystem::system_complete(argv[0]).parent_path(), ec).string() + "/" + boost::filesystem::system_complete(argv[0]).filename().string()); + if (ec.value() > 0) { + // Still not valid, process without canonical + hashed_path = std::hash{}(boost::filesystem::system_complete(argv[0]).string()); } + } #endif // win32 std::string lock_name = std::to_string(hashed_path);