diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h index b53bfdb323..ddba9d527d 100644 --- a/modules/juce_core/native/juce_posix_SharedCode.h +++ b/modules/juce_core/native/juce_posix_SharedCode.h @@ -1042,10 +1042,11 @@ public: ActiveProcess (const StringArray& arguments, int streamFlags) : childPID (0), pipeHandle (0), readHandle (0) { + String exe (arguments[0].unquoted()); + // Looks like you're trying to launch a non-existent exe or a folder (perhaps on OSX // you're trying to launch the .app folder rather than the actual binary inside it?) - jassert ((! arguments[0].containsChar ('/')) - || File::getCurrentWorkingDirectory().getChildFile (arguments[0]).existsAsFile()); + jassert (File::getCurrentWorkingDirectory().getChildFile (exe).existsAsFile()); int pipeHandles[2] = { 0 }; @@ -1078,11 +1079,11 @@ public: Array argv; for (int i = 0; i < arguments.size(); ++i) if (arguments[i].isNotEmpty()) - argv.add (const_cast (arguments[i].toUTF8().getAddress())); + argv.add (const_cast (arguments[i].toRawUTF8())); argv.add (nullptr); - execvp (argv[0], argv.getRawDataPointer()); + execvp (exe.toRawUTF8(), argv.getRawDataPointer()); exit (-1); } else