mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-26 09:56:32 +08:00
Report 1-based positions in wxFileConfig warning message
0-based positions are probably not what the users expect.
This commit is contained in:
@@ -2151,7 +2151,7 @@ static wxString FilterInValue(const wxString& str)
|
||||
else if ( i != end - 1 )
|
||||
{
|
||||
wxLogWarning(_("unexpected \" at position %zu in '%s'."),
|
||||
i - str.begin(), str);
|
||||
i - str.begin() + 1, str);
|
||||
}
|
||||
//else: it's the last quote of a quoted string, ok
|
||||
}
|
||||
|
||||
@@ -657,7 +657,7 @@ TEST_CASE_METHOD(LogTestCase, "wxFileConfig::Error", "[fileconfig][error]")
|
||||
checkWarning("foo=\\", "trailing backslash");
|
||||
|
||||
// Check that it's the second quote which is unexpected, not the first one.
|
||||
checkWarning(R"(foo="x"y)", R"(unexpected " at position 2)");
|
||||
checkWarning(R"(foo="x"y)", R"(unexpected " at position 3)");
|
||||
}
|
||||
|
||||
#endif // wxUSE_FILECONFIG
|
||||
|
||||
Reference in New Issue
Block a user