X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Finspircd_io.cpp;h=d8e0954416a19e1ee4660717b0de8b70d1f5bce1;hb=1f487855a5097c65aaad4752df259b9a877ba364;hp=6e36de4778f00943196b0bfcba3dd27e5c2afef8;hpb=8cc90ca14d84ef8ec83989de45854a2c7855ee4f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp index 6e36de477..d8e095441 100644 --- a/src/inspircd_io.cpp +++ b/src/inspircd_io.cpp @@ -105,7 +105,7 @@ int EnumConf(const char* filename, const char* tag) { FILE *config; int ptr = 0; - char buffer[MAXBUF], c_tag[MAXBUF], c; + char buffer[MAXBUF], c_tag[MAXBUF], c, lastc; int in_token, in_quotes, tptr, j, idx = 0; char* key; @@ -118,9 +118,19 @@ int EnumConf(const char* filename, const char* tag) ptr = 0; in_token = 0; in_quotes = 0; + lastc = '\0'; while (!feof(config)) { + lastc = c; c = fgetc(config); + if ((c == '#') && (lastc == '\n')) + { + while ((c != '\n') && (!feof(config))) + { + lastc = c; + c = fgetc(config); + } + } if ((c == '<') && (!in_quotes)) { tptr = 0; @@ -184,7 +194,7 @@ int ReadConf(const char* filename, const char* tag, const char* var, int index, { FILE *config; int ptr = 0; - char buffer[MAXBUF], c_tag[MAXBUF], c; + char buffer[MAXBUF], c_tag[MAXBUF], c, lastc; int in_token, in_quotes, tptr, j, idx = 0; char* key; @@ -197,9 +207,19 @@ int ReadConf(const char* filename, const char* tag, const char* var, int index, ptr = 0; in_token = 0; in_quotes = 0; + lastc = '\0'; while (!feof(config)) { + lastc = c; c = fgetc(config); + if ((c == '#') && (lastc == '\n')) + { + while ((c != '\n') && (!feof(config))) + { + lastc = c; + c = fgetc(config); + } + } if ((c == '<') && (!in_quotes)) { tptr = 0;