summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-08 17:47:47 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-08 17:47:47 +0000
commit630d1eed7842d3f47505407b98f5a7df8878e49e (patch)
treed6f48d40386d11e85d3f840d9d50ca83e5a2d956 /src
parent7141595fda12cc3ec24ecc38543f20b515825f22 (diff)
Attempted config fix for end of line missing
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2272 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/inspircd_io.cpp12
1 files changed, 12 insertions, 0 deletions
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);