From 630d1eed7842d3f47505407b98f5a7df8878e49e Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 8 Dec 2005 17:47:47 +0000 Subject: Attempted config fix for end of line missing git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2272 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd_io.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp index ac5f66821..4d2369d23 100644 --- a/src/inspircd_io.cpp +++ b/src/inspircd_io.cpp @@ -286,6 +286,8 @@ std::string ConfProcess(char* buffer, long linenumber, std::stringstream* errors return parsedata; } +/* A special version of fgets that will read \r, \n, \r\n or even \n\r, it doesnt care :-) */ + int fgets_safe(char* buffer, size_t maxsize, FILE* &file) { char c_read = '\0'; @@ -394,6 +396,16 @@ bool LoadConf(const char* filename, std::stringstream *target, std::stringstream } } } + if (*buffer) + { + bool error = false; + std::string data = ConfProcess(buffer,linenumber++,errorstream,error,filename); + if (error) + { + return false; + } + *target << data; + } fclose(conf); } target->seekg(0); -- cgit v1.2.3