This commit is contained in:
Morilli 2023-06-07 23:01:12 +02:00
parent 9e5fb35f7a
commit 13dd04a026
1 changed files with 9 additions and 2 deletions

View File

@ -109,8 +109,15 @@ namespace BizHawk.Client.EmuHawk
public void DeduceFormat(string commandline)
{
string formatKey = "-f ";
Extension = commandline.Substring(commandline.IndexOf(formatKey) + formatKey.Length);
var splitCommandLine = commandline.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
for (int index = 0; index < splitCommandLine.Length - 1; index++)
{
if (splitCommandLine[index] == "-f")
{
Extension = splitCommandLine[index + 1];
break;
}
}
// are there other formats that don't match their file extensions?
if (Extension == "matroska")