+2000-11-28 Kevin L. Mitchell <klmitch@mit.edu>
+
+ * ircd/motd.c: we were setting type to MOTD_CLASS unconditionally,
+ which was of course stupid; switched to using switch/case in
+ initialization in motd_create(); zero the MotdList.other pointer
+ from motd_clear()
+
+ * ircd/ircd.c (main): motd_init() has to come before init_conf(),
+ or we overwrite init_conf()'s hard work with respect to T-lines
+
2000-11-27 Kevin L. Mitchell <klmitch@mit.edu>
* ircd/s_stats.c: comment out report_motd_list and include a
init_resolver();
+ motd_init();
+
if (!init_conf()) {
ircd_log(L_CRIT, "Failed to read configuration file %s", configfile);
return 7;
uping_init();
- motd_init();
-
CurrentTime = time(NULL);
SetMe(&me);
motd_create(const char *hostmask, const char *path, int maxcount)
{
struct Motd* tmp;
- int class = -1;
int type = MOTD_UNIVERSAL;
const char* s;
assert(0 != path);
if (hostmask) { /* figure out if it's a class or hostmask */
+ type = MOTD_CLASS; /* all digits, convert to class */
+
for (s = hostmask; *s; s++)
if (!IsDigit(*s)) { /* not a digit, not a class... */
type = MOTD_HOSTMASK;
break;
}
-
- type = MOTD_CLASS; /* all digits, convert to class */
- class = atoi(hostmask);
}
/* allocate memory and initialize the structure */
tmp->next = 0;
tmp->type = type;
- if (type == MOTD_HOSTMASK)
+
+ switch (type) {
+ case MOTD_HOSTMASK:
DupString(tmp->id.hostmask, hostmask);
- else if (type == MOTD_CLASS)
- tmp->id.class = class;
+ break;
+
+ case MOTD_CLASS:
+ tmp->id.class = atoi(hostmask);
+ break;
+ }
+
DupString(tmp->path, path);
tmp->maxcount = maxcount;
tmp->cache = 0;
motd_destroy(ptr);
}
+ MotdList.other = 0;
+
/* now recache local and remote MOTDs */
motd_cache(MotdList.local);
motd_cache(MotdList.remote);