pcsx2: Warn if GameDB section start tag is incorrect

This helps avoid patches not being applied due to whitespace mismatches.
For example:
[patches ]
[ patches]
[patches  =  012345678]
This commit is contained in:
Jonathan Li 2018-09-06 01:52:19 +01:00
parent f47321c287
commit 7433ee7fc1
1 changed files with 5 additions and 1 deletions

View File

@ -77,7 +77,11 @@ bool DBLoaderHelper::extractMultiLine() {
// Use Mid() to strip off the left and right side brackets.
wxString midLine(m_dest.Mid(1, m_dest.Length()-2));
wxString lvalue(midLine.BeforeFirst(L'=').Trim(true).Trim(false));
//wxString rvalue(midLine.AfterFirst(L'=').Trim(true).Trim(false));
wxString rvalue(midLine.AfterFirst(L'=').Trim(true).Trim(false));
wxString key = '[' + lvalue + (rvalue.empty() ? "" : " = ") + rvalue + ']';
if (key != m_keyPair.key)
Console.Warning("GameDB: Badly formatted section start tag.\nActual: " + m_keyPair.key + "\nExpected: " + key);
wxString endString;
endString.Printf( L"[/%s]", lvalue.c_str() );