Normalize the string returned by Extension() to lowercase.

This would otherwise break code that branches on the extension,
such as that after 06a188cc.
This commit is contained in:
whitequark 2016-10-10 20:34:11 +00:00
parent 5e28b35f2b
commit 1a5047550d

View File

@ -427,8 +427,11 @@ void SolveSpaceUI::UpdateWindowTitle(void) {
static std::string Extension(const std::string &filename) {
int dot = filename.rfind('.');
if(dot >= 0)
return filename.substr(dot + 1, filename.length());
if(dot >= 0) {
std::string ext = filename.substr(dot + 1, filename.length());
std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower);
return ext;
}
return "";
}