summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);