From f598d67c16d5ec0bb668de93b3e2e50c667df201 Mon Sep 17 00:00:00 2001 From: "geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Mon, 24 Sep 2007 17:32:33 +0000 Subject: 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 --- src/modules.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/modules.c') diff --git a/src/modules.c b/src/modules.c index a02593119..b54d1fa58 100644 --- a/src/modules.c +++ b/src/modules.c @@ -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); -- cgit