summaryrefslogtreecommitdiff
path: root/src/client/client.cpp
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2020-09-16 14:51:11 +0100
committerGitHub <noreply@github.com>2020-09-16 14:51:11 +0100
commit9ec75d77651c333eca3c5b46a3a56c8353fed464 (patch)
treefb8d42716279514e8850e53e47973a0f6d0ef7d5 /src/client/client.cpp
parentc8303f790ccb03857d031ecb73de7f9f59a6ceba (diff)
downloadminetest-9ec75d77651c333eca3c5b46a3a56c8353fed464.tar.gz
minetest-9ec75d77651c333eca3c5b46a3a56c8353fed464.tar.bz2
minetest-9ec75d77651c333eca3c5b46a3a56c8353fed464.zip
Clean up server-side translations, remove global variable (#10075)
Diffstat (limited to 'src/client/client.cpp')
-rw-r--r--src/client/client.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/client/client.cpp b/src/client/client.cpp
index 745cce900..d6e529c40 100644
--- a/src/client/client.cpp
+++ b/src/client/client.cpp
@@ -238,18 +238,13 @@ void Client::scanModSubfolder(const std::string &mod_name, const std::string &mo
infostream << "Client::scanModSubfolder(): Loading \"" << real_path
<< "\" as \"" << vfs_path << "\"." << std::endl;
- std::ifstream is(real_path, std::ios::binary | std::ios::ate);
- if(!is.good()) {
+ std::string contents;
+ if (!fs::ReadFile(real_path, contents)) {
errorstream << "Client::scanModSubfolder(): Can't read file \""
<< real_path << "\"." << std::endl;
continue;
}
- auto size = is.tellg();
- std::string contents(size, '\0');
- is.seekg(0);
- is.read(&contents[0], size);
- infostream << " size: " << size << " bytes" << std::endl;
m_mod_vfs.emplace(vfs_path, contents);
}
}