diff options
author | Vojtech Kral <vojtech@kral.hk> | 2018-06-11 19:30:40 +0300 |
---|---|---|
committer | Vojtech Kral <vojtech@kral.hk> | 2018-06-11 19:30:40 +0300 |
commit | 7426291e9fd69d8f8f8644a1803ddb5ec847de1d (patch) | |
tree | 7469d5f15f31175032a685e7d8a0a192e1348952 /xs | |
parent | 43e8fe32aac28c8c8d3355aa4106d7a0e1c30292 (diff) |
PresetUpdater: Fix of the fix
Diffstat (limited to 'xs')
-rw-r--r-- | xs/src/slic3r/Utils/PresetUpdater.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xs/src/slic3r/Utils/PresetUpdater.cpp b/xs/src/slic3r/Utils/PresetUpdater.cpp index 80651aece..f34fc4c19 100644 --- a/xs/src/slic3r/Utils/PresetUpdater.cpp +++ b/xs/src/slic3r/Utils/PresetUpdater.cpp @@ -440,7 +440,9 @@ void PresetUpdater::priv::copy_file(const fs::path &source, const fs::path &targ static const auto perms = fs::owner_read | fs::owner_write | fs::group_read | fs::others_read; // aka 644 // Make sure the file has correct permission both before and after we copy over it - fs::permissions(target, perms); + if (fs::exists(target)) { + fs::permissions(target, perms); + } fs::copy_file(source, target, fs::copy_option::overwrite_if_exists); fs::permissions(target, perms); } |