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:
parent
e051b5ad8f
commit
b010df5bcd
1 changed files with 5 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue