nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1diff --git a/src/hints/HintsToPot.cpp b/src/hints/HintsToPot.cpp
2index 7c8029cdeb..4791f0612f 100644
3--- a/src/hints/HintsToPot.cpp
4+++ b/src/hints/HintsToPot.cpp
5@@ -9,7 +9,7 @@
6
7 bool write_to_pot(boost::filesystem::path path, const std::vector<std::pair<std::string, std::string>>& data)
8 {
9- boost::filesystem::ofstream file(std::move(path), std::ios_base::app);
10+ boost::nowide::ofstream file(path.string(), std::ios_base::app);
11 for (const auto& element : data)
12 {
13 //Example of .pot element
14diff --git a/src/slic3r/GUI/RemovableDriveManager.cpp b/src/slic3r/GUI/RemovableDriveManager.cpp
15index 2f8ac96a1a..f0f95c9459 100644
16--- a/src/slic3r/GUI/RemovableDriveManager.cpp
17+++ b/src/slic3r/GUI/RemovableDriveManager.cpp
18@@ -22,7 +22,8 @@
19 #include <pwd.h>
20 #include <boost/filesystem.hpp>
21 #include <boost/system/error_code.hpp>
22-#include <boost/filesystem/convenience.hpp>
23+#include <boost/filesystem/path.hpp>
24+#include <boost/filesystem/operations.hpp>
25 #include <boost/process.hpp>
26 #endif
27
28diff --git a/src/slic3r/GUI/ScriptExecutor.cpp b/src/slic3r/GUI/ScriptExecutor.cpp
29index 3e10680e46..374915ee34 100644
30--- a/src/slic3r/GUI/ScriptExecutor.cpp
31+++ b/src/slic3r/GUI/ScriptExecutor.cpp
32@@ -825,6 +825,19 @@ void as_back_custom_initial_value(int preset_type, std::string& key) {
33 set_custom_option(preset_type, serialized_vars);
34 }
35
36+inline void load_string_file(boost::filesystem::path const& p, std::string& str)
37+{
38+ boost::filesystem::ifstream file;
39+ file.exceptions(std::ios_base::failbit | std::ios_base::badbit);
40+ file.open(p, std::ios_base::binary);
41+ const boost::uintmax_t sz = boost::filesystem::file_size(p);
42+ if (BOOST_UNLIKELY(sz > static_cast< boost::uintmax_t >((std::numeric_limits< std::streamsize >::max)())))
43+ BOOST_FILESYSTEM_THROW(std::length_error("File size exceeds max read size"));
44+ str.resize(static_cast< std::size_t >(sz), '\0');
45+ if (sz > 0u)
46+ file.read(&str[0], static_cast< std::streamsize >(sz));
47+}
48+
49 /////// main script fucntions //////
50
51 //TODO: add "unset" function, that revert to last value (befoer a scripted set) if a set has been made since last not-scripted change.
52@@ -960,7 +973,7 @@ void ScriptContainer::init(const std::string& tab_key, Tab* tab)
53 //res = builder.AddSectionFromFile(ui_script_file.string().c_str()); //seems to be problematic on cyrillic locale
54 {
55 std::string all_file;
56- boost::filesystem::load_string_file(ui_script_file, all_file);
57+ load_string_file(ui_script_file, all_file);
58 res = builder.AddSectionFromMemory(ui_script_file.string().c_str(), all_file.c_str(), (unsigned int)(all_file.length()), 0);
59 }
60 if (res < 0) throw CompileErrorException("Error, can't build the script for tab " + tab_key);