More CHD related fixes

- CHDReturnError was not handled and would cause an exception/crash
- CHD error/filename were swapped in ErrorGrid when scanning
- Use regex when parsing chdman stdout output
This commit is contained in:
Jim Westfall
2014-10-29 20:20:37 -07:00
parent 7f6b01516d
commit 634de3b3d7
2 changed files with 4 additions and 3 deletions

View File

@@ -334,7 +334,7 @@ namespace ROMVault2.SupportedFiles.CHD
switch (_outputLineCount)
{
case 0:
if (sOut.Length < 53 || sOut.Substring(0, 53) != "chdman - MAME Compressed Hunks of Data (CHD) manager ")
if (!System.Text.RegularExpressions.Regex.IsMatch(sOut, @"^chdman - MAME Compressed Hunks of Data \(CHD\) manager ([0-9\.]+) \(.*\)"))
{
_result = "Incorrect startup of CHDMan :" + sOut;
_resultType = CHDManCheck.CHDReturnError;