aboutsummaryrefslogtreecommitdiffstats
path: root/src/fileutils.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2020-02-06 01:25:25 +0000
committerGravatar Sadie Powell2020-02-06 01:53:16 +0000
commit8d9b0e75700d35a00066c6dad8670fa8e5a438a3 (patch)
tree98696b3d05a5bc2d56f17b606d1f32116c1adace /src/fileutils.cpp
parentMake WritePID read directly from the config. (diff)
downloadinspircd++-8d9b0e75700d35a00066c6dad8670fa8e5a438a3.tar.gz
inspircd++-8d9b0e75700d35a00066c6dad8670fa8e5a438a3.tar.bz2
inspircd++-8d9b0e75700d35a00066c6dad8670fa8e5a438a3.zip
In C++11 [io]fstream has std::string constructors; use them.
Diffstat (limited to 'src/fileutils.cpp')
-rw-r--r--src/fileutils.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/fileutils.cpp b/src/fileutils.cpp
index c99673d22..9f98d7a50 100644
--- a/src/fileutils.cpp
+++ b/src/fileutils.cpp
@@ -41,13 +41,11 @@ void FileReader::Load(const std::string& filename)
}
else
{
- const std::string realName = ServerInstance->Config->Paths.PrependConfig(filename);
- lines.clear();
-
- std::ifstream stream(realName.c_str());
+ std::ifstream stream(ServerInstance->Config->Paths.PrependConfig(filename));
if (!stream.is_open())
throw CoreException(filename + " does not exist or is not readable!");
+ lines.clear();
std::string line;
while (std::getline(stream, line))
{