1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
| | This patch backports a solution for the issue:
https://github.com/prusa3d/PrusaSlicer/issues/5542
that causes PrusaSlicer to crash when invoked
from the command line by means of the $PATH variable.
This fix is applied in:
https://github.com/prusa3d/PrusaSlicer/commit/293f85b6cf9b805af93b9f79f5ff878b6d673969
quite after the release of 2.3.3, so this backport is needed.
diff --git a/src/PrusaSlicer.cpp b/src/PrusaSlicer.cpp
index b0df2c99a..31e30af81 100644
--- a/src/PrusaSlicer.cpp
+++ b/src/PrusaSlicer.cpp
@@ -28,6 +28,7 @@
#include <boost/nowide/cenv.hpp>
#include <boost/nowide/iostream.hpp>
#include <boost/nowide/integration/filesystem.hpp>
+#include <boost/dll/runtime_symbol_info.hpp>
#include "unix/fhs.hpp" // Generated by CMake from ../platform/unix/fhs.hpp.in
@@ -612,7 +613,9 @@ bool CLI::setup(int argc, char **argv)
// Detect the operating system flavor after SLIC3R_LOGLEVEL is set.
detect_platform();
- boost::filesystem::path path_to_binary = boost::filesystem::system_complete(argv[0]);
+ // See Invoking prusa-slicer from $PATH environment variable crashes #5542
+ // boost::filesystem::path path_to_binary = boost::filesystem::system_complete(argv[0]);
+ boost::filesystem::path path_to_binary = boost::dll::program_location();
// Path from the Slic3r binary to its resources.
#ifdef __APPLE__
|