Fix for postprocessing scripts not working on UNIX when $SHELL is undefined (#4101)

Fix for PP scripts not working on UNIX when $SHELL is undefined

thanks @jfbauer432 for pointing the problem out.
thanks @lukasmatena for fixing it in PrusaSlicer (commit 87a5116)

Co-authored-by: Lukáš Matěna <lukasmatena@seznam.cz>
This commit is contained in:
pagdot 2024-02-18 13:47:22 +01:00 committed by SoftFever
parent 407661522f
commit 1f835e01fc

View file

@ -157,7 +157,7 @@ static int run_script(const std::string &script, const std::string &gcode, std::
{
// Try to obtain user's default shell
const char *shell = ::getenv("SHELL");
if (shell == nullptr) { shell = "sh"; }
if (shell == nullptr) { shell = "/bin/sh"; }
// Quote and escape the gcode path argument
std::string command { script };