From 34cab7caffbb66623bb4d6a4d204dc033d057209 Mon Sep 17 00:00:00 2001 From: binki Date: Mon, 14 Mar 2011 19:03:41 +0000 Subject: [PATCH] - Fix empty/nonexistent short MOTD being shown instead of the full MOTD on user registration. Thanks WakiMiko (#4011). --- Changes | 2 ++ src/s_serv.c | 20 +++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Changes b/Changes index 30e77a1f9..cafeacc64 100644 --- a/Changes +++ b/Changes @@ -2269,3 +2269,5 @@ you can use deny link { } blocks if you want to deny older versions than this release. - Fix documentation about channel mode +t and halfops, thanks warg (#4007). +- Fix empty/nonexistent short MOTD being shown instead of the full + MOTD on user registration. Thanks WakiMiko (#4011). diff --git a/src/s_serv.c b/src/s_serv.c index 03c3d23d2..5b4a9f08c 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -909,26 +909,24 @@ int short_motd(aClient *sptr) tld = Find_tld(sptr, userhost); /* - Try different sources of short MOTDs, falling back to - the long MOTD. + * Try different sources of short MOTDs, falling back to the + * long MOTD. */ - themotd = NULL; - if (tld) + themotd = &smotd; + if (tld && tld->smotd.lines) themotd = &tld->smotd; - if (!themotd) - themotd = &smotd; /* try long MOTDs */ - if (!themotd) + if (!themotd->lines) { is_short = 0; - if (tld) + if (tld && tld->motd.lines) themotd = &tld->motd; + else + themotd = &motd; } - if (!themotd) - themotd = &motd; - if (!themotd) + if (!themotd->lines) { sendto_one(sptr, err_str(ERR_NOMOTD), me.name, sptr->name); return 0;