diff --git a/Changes b/Changes index 3e0885313..f85b78a74 100644 --- a/Changes +++ b/Changes @@ -657,3 +657,5 @@ seen. gmtime warning still there - Win32 fixes - Made a /scan fix, and fixed some version numbers found by Morbid - Updated m_template.c to use module version 2 +- Removed a // comment in src/ircd.c +- Fixed a bunch of updconf bugs reported by DarkSypher diff --git a/src/ircd.c b/src/ircd.c index b50e67c4a..1ea9ac2df 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -1291,7 +1291,7 @@ void SocketLoop(void *dummy) } #endif - //Debug((DEBUG_DEBUG, "Got message(s)")); + /*Debug((DEBUG_DEBUG, "Got message(s)")); */ /* ** ...perhaps should not do these loops every time, ** but only if there is some chance of something diff --git a/src/updconf.c b/src/updconf.c index a9e8ef784..79ecb79ac 100644 --- a/src/updconf.c +++ b/src/updconf.c @@ -337,10 +337,9 @@ int main(int argc, char *argv[]) { fprintf(fd2, "/* Created using the UnrealIRCd configuration file updater */\n\n"); while (fgets(buf, 1023, fd)) { - if (buf[0] == '#') + if (buf[0] == '#' || buf[0] == '\n' || buf[0] == '\r') continue; iCstrip(buf); - if (buf[1] == ':') { /* Regular config line, switch! */ switch(buf[0]) { @@ -664,32 +663,34 @@ int main(int argc, char *argv[]) { break; } } - tmp = strtok(buf, " "); - if (!strcmp(tmp, "deny")) { - fprintf(fd2, "deny dcc {\n"); - fprintf(fd2, "\tmask \"%s\";\n",strtok(NULL, " ")); - fprintf(fd2, "\treason \"%s\"\n};\n",strtok(NULL,"")); - continue; - } - if (!strcmp(tmp, "allow")) { - fprintf(fd2, "allow channel {\n"); - fprintf(fd2, "\tchannel \"%s\";\n",strtok(NULL, " ")); - continue; - } - if (!strcmp(tmp, "vhost")) { - char host[100]; - tmp = strtok(&buf[2]," "); - vh = add_vhost(strtok(NULL, " ")); - AllocCpy(vh->vhost,tmp); - AllocCpy(vh->pass,strtok(NULL," ")); - tmp = strtok(NULL, ""); - strcpy(host,tmp); - if (!strchr(tmp,'@')) - sprintf(host, "*@%s",tmp); - else - strcpy(host, tmp); - if (!find_vhost_host(vh, host)) - add_vhost_host(vh, host); + else { + tmp = strtok(buf, " "); + if (!strcmp(tmp, "deny")) { + fprintf(fd2, "deny dcc {\n"); + fprintf(fd2, "\tmask \"%s\";\n",strtok(NULL, " ")); + fprintf(fd2, "\treason \"%s\"\n};\n",strtok(NULL,"")); + continue; + } + else if (!strcmp(tmp, "allow")) { + fprintf(fd2, "allow channel {\n"); + fprintf(fd2, "\tchannel \"%s\";\n",strtok(NULL, " ")); + continue; + } + else if (!strcmp(tmp, "vhost")) { + char host[100]; + tmp = strtok(NULL," "); + vh = add_vhost(tmp); + AllocCpy(vh->vhost,tmp); + AllocCpy(vh->pass,strtok(NULL," ")); + tmp = strtok(NULL, ""); + strcpy(host,tmp); + if (!strchr(tmp,'@')) + sprintf(host, "*@%s",tmp); + else + strcpy(host, tmp); + if (!find_vhost_host(vh, host)) + add_vhost_host(vh, host); + } } }