Skip to content

Commit a5ca508

Browse files
committed
Lowercase lua extension check
1 parent 10ea0cf commit a5ca508

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

include/Common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ class Application final {
131131
};
132132

133133
void SplitString(std::string const& str, const char delim, std::vector<std::string>& out);
134+
std::string LowerString(std::string str);
134135

135136
std::string ThreadName(bool DebugModeOverride = false);
136137
void RegisterThread(const std::string& str);

src/Common.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,13 @@ void SplitString(const std::string& str, const char delim, std::vector<std::stri
384384
out.push_back(str.substr(start, end - start));
385385
}
386386
}
387+
388+
std::string LowerString(std::string str) {
389+
std::ranges::transform(str, str.begin(), ::tolower);
390+
return str;
391+
}
392+
393+
387394
static constexpr size_t STARTING_MAX_DECOMPRESSION_BUFFER_SIZE = 15 * 1024 * 1024;
388395
static constexpr size_t MAX_DECOMPRESSION_BUFFER_SIZE = 30 * 1024 * 1024;
389396

src/TPluginMonitor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void TPluginMonitor::operator()() {
5757
mFileTimes[Pair.first] = CurrentTime;
5858
// grandparent of the path should be Resources/Server
5959
if (fs::equivalent(fs::path(Pair.first).parent_path().parent_path(), mPath)) {
60-
if (fs::path(Pair.first).extension() == ".lua") {
60+
if (LowerString(fs::path(Pair.first).extension().string()) == ".lua") {
6161
beammp_infof("File \"{}\" changed, reloading", Pair.first);
6262
// is in root folder, so reload
6363
std::ifstream FileStream(Pair.first, std::ios::in | std::ios::binary);

0 commit comments

Comments
 (0)