diff options
author | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2007-09-24 17:32:33 +0000 |
---|---|---|
committer | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2007-09-24 17:32:33 +0000 |
commit | f598d67c16d5ec0bb668de93b3e2e50c667df201 (patch) | |
tree | c116fdc7252f711cc66acf519aeee77a6d622fb7 /src | |
parent | b289f05fbf2446b367a7b14f397932eec0c16dc3 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/modules.c | 17 |
1 files changed, 14 insertions, 3 deletions
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); |