1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Made ChildProcess::start() auto-remove quotes from the name of the executable that it is given

This commit is contained in:
jules 2016-02-12 10:51:25 +00:00
parent e051b5ad8f
commit b010df5bcd

View file

@ -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<char*> argv;
for (int i = 0; i < arguments.size(); ++i)
if (arguments[i].isNotEmpty())
argv.add (const_cast<char*> (arguments[i].toUTF8().getAddress()));
argv.add (const_cast<char*> (arguments[i].toRawUTF8()));
argv.add (nullptr);
execvp (argv[0], argv.getRawDataPointer());
execvp (exe.toRawUTF8(), argv.getRawDataPointer());
exit (-1);
}
else