From bed82da3526515ba1b2487f1ad45a5d85da321ed Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 30 Apr 2016 21:10:48 -0700 Subject: [PATCH] Make ini case insensitive. --- Core/TextureReplacer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/TextureReplacer.cpp b/Core/TextureReplacer.cpp index 3e3520794f..99cf4fcff5 100644 --- a/Core/TextureReplacer.cpp +++ b/Core/TextureReplacer.cpp @@ -19,6 +19,7 @@ #include #endif +#include #include "ext/xxhash.h" #include "file/ini_file.h" #include "Common/ColorConv.h" @@ -79,7 +80,7 @@ bool TextureReplacer::LoadIni() { std::string hash; options->Get("hash", &hash, ""); // TODO: crc32c. - if (hash == "quick") { + if (strcasecmp(hash.c_str(), "quick") == 0) { hash_ = ReplacedTextureHash::QUICK; } else { ERROR_LOG(G3D, "Unsupported hash type: %s", hash.c_str()); @@ -95,7 +96,8 @@ bool TextureReplacer::LoadIni() { if (ini.GetKeys("hashes", hashNames)) { auto hashes = ini.GetOrCreateSection("hashes"); // Format: hashname = filename.png - for (const std::string &hashName : hashNames) { + for (std::string hashName : hashNames) { + std::transform(hashName.begin(), hashName.end(), hashName.begin(), tolower); hashes->Get(hashName.c_str(), &aliases_[hashName], ""); } }