Fix freeze when timidity_exe is not set to timidity's absolute path

This commit is contained in:
Kevin Caccamo 2017-07-31 08:15:51 -04:00 committed by Rachael Alexanderson
parent 18e76c978c
commit ff35620a09

View file

@ -532,13 +532,15 @@ bool TimidityPPMIDIDevice::LaunchTimidity ()
do
{
spaceIdx = CommandLine.IndexOf(' ', spaceIdx);
spaceInExePathCount += 1;
TimidityExe = CommandLine.Left(spaceIdx);
glob(TimidityExe.GetChars(), 0, NULL, &glb);
} while (spaceIdx != -1 && glb.gl_pathc == 0);
if (spaceIdx == -1)
spaceIdx += 1;
spaceInExePathCount += 1;
} while (spaceIdx != 0 && glb.gl_pathc == 0);
if (spaceIdx == 0)
{
TimidityExe = FString("timidity"); // Maybe it's in your PATH?
spaceInExePathCount = 0;
}
globfree(&glb);