1
0
mirror of https://github.com/anope/anope.git synced 2026-07-03 05:33:13 +02:00

BUILD : 1.7.19 (1308) BUGS : 787 NOTES : Applied a patch by T fixing moduleGetConfigDirective disliking CRLF line-ends

git-svn-id: svn://svn.anope.org/anope/trunk@1308 31f1291d-b8d6-0310-a050-a5561fc1590b


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1026 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b
2007-09-24 17:32:33 +00:00
parent b289f05fbf
commit f598d67c16
3 changed files with 20 additions and 4 deletions
+14 -3
View File
@@ -2482,6 +2482,7 @@ int moduleGetConfigDirective(Directive * d)
FILE *config;
char *dir = NULL;
char buf[1024];
char *directive;
int linenum = 0;
int ac = 0;
char *av[MAXPARAMS];
@@ -2497,8 +2498,9 @@ int moduleGetConfigDirective(Directive * d)
}
while (fgets(buf, sizeof(buf), config)) {
linenum++;
if (*buf == '#' || *buf == '\r' || *buf == '\n')
if (*buf == '#' || *buf == '\r' || *buf == '\n') {
continue;
}
dir = myStrGetOnlyToken(buf, '\t', 0);
if (dir) {
str = myStrGetTokenRemainder(buf, '\t', 1);
@@ -2510,7 +2512,13 @@ int moduleGetConfigDirective(Directive * d)
continue;
}
}
if (stricmp(dir, d->name) == 0) {
if (dir) {
directive = normalizeBuffer(dir);
} else {
continue;
}
if (stricmp(directive, d->name) == 0) {
if (str) {
s = str;
while (isspace(*s))
@@ -2543,8 +2551,11 @@ int moduleGetConfigDirective(Directive * d)
s++;
}
}
retval = parse_directive(d, dir, ac, av, linenum, 0, s);
retval = parse_directive(d, directive, ac, av, linenum, 0, s);
}
if (directive) {
free(directive);
}
}
if (dir)
free(dir);