mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
fixed warning 'unexpected key ""' at end of file
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@248 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -130,10 +130,10 @@ void Reader::unknownKey() {
|
||||
if (it != aliasses.end()) {
|
||||
if (aliasses.find(it->second.new_key) != aliasses.end()) {
|
||||
// alias points to another alias, don't follow it, there is the risk of infinite loops
|
||||
} else if (it->second.end_version <= file_version) {
|
||||
} else if (it->second.end_version <= file_app_version) {
|
||||
// alias not used for this version, use in warning
|
||||
if (indent == expected_indent) {
|
||||
warning(_("Unexpected key: '") + key + _("' try '") + it->second.new_key + _("'"));
|
||||
warning(_("Unexpected key: '") + key + _("' use '") + it->second.new_key + _("'"));
|
||||
do {
|
||||
moveNext();
|
||||
} while (indent > expected_indent);
|
||||
@@ -176,6 +176,11 @@ const String& Reader::getValue() {
|
||||
while (key.empty() && !input->Eof()) {
|
||||
readLine();
|
||||
}
|
||||
// did we reach the end of the file?
|
||||
if (key.empty() && input->Eof()) {
|
||||
line_number += 1;
|
||||
indent = -1;
|
||||
}
|
||||
return multi_line_str;
|
||||
} else {
|
||||
return value;
|
||||
|
||||
Reference in New Issue
Block a user