When trying to find a section by name, try known sections names

* In theory all sections of a known type should be written with their
  proper normalised name, but just in case a capture is a bit misformed
  let's try to look it up by type.
This commit is contained in:
baldurk
2017-12-20 17:16:09 +00:00
parent 0c1d602c37
commit 6f0756c6dd
+6
View File
@@ -696,6 +696,12 @@ int RDCFile::SectionIndex(const char *name) const
if(m_Sections[i].name == name)
return int(i);
// last ditch, see if name is a known section type and search for that type. This should have been
// normalised on write, but maybe it didn't
for(SectionType s : values<SectionType>())
if(ToStr(s) == name)
return SectionIndex(s);
return -1;
}