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:
@@ -820,11 +820,12 @@ namespace ROMVault2
|
|||||||
tFile.FileStatusSet(FileStatus.SHA1CHDVerified);
|
tFile.FileStatusSet(FileStatus.SHA1CHDVerified);
|
||||||
return;
|
return;
|
||||||
case CHD.CHDManCheck.Corrupt:
|
case CHD.CHDManCheck.Corrupt:
|
||||||
_bgw.ReportProgress(0, new bgwShowError(error, filename));
|
_bgw.ReportProgress(0, new bgwShowError(filename, error));
|
||||||
tFile.GotStatus = GotStatus.Corrupt;
|
tFile.GotStatus = GotStatus.Corrupt;
|
||||||
return;
|
return;
|
||||||
|
case CHD.CHDManCheck.CHDReturnError:
|
||||||
case CHD.CHDManCheck.CHDUnknownError:
|
case CHD.CHDManCheck.CHDUnknownError:
|
||||||
_bgw.ReportProgress(0, new bgwShowError(error, filename));
|
_bgw.ReportProgress(0, new bgwShowError(filename, error));
|
||||||
return;
|
return;
|
||||||
case CHD.CHDManCheck.ChdmanNotFound:
|
case CHD.CHDManCheck.ChdmanNotFound:
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ namespace ROMVault2.SupportedFiles.CHD
|
|||||||
switch (_outputLineCount)
|
switch (_outputLineCount)
|
||||||
{
|
{
|
||||||
case 0:
|
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;
|
_result = "Incorrect startup of CHDMan :" + sOut;
|
||||||
_resultType = CHDManCheck.CHDReturnError;
|
_resultType = CHDManCheck.CHDReturnError;
|
||||||
|
|||||||
Reference in New Issue
Block a user