From: Sergey Matveev Date: Wed, 14 May 2014 12:18:40 +0000 (+0400) Subject: Omit last empty string from MOTD reply X-Git-Tag: 1.0~27 X-Git-Url: http://www.git.cypherpunks.ru/?p=goircd.git;a=commitdiff_plain;h=6d2c47a7af3afc09b3b8899d9b770b58e2792d31;hp=043730c35562365191764faf321424eb7bec0513 Omit last empty string from MOTD reply --- diff --git a/daemon.go b/daemon.go index 59d6372..49e2dd8 100644 --- a/daemon.go +++ b/daemon.go @@ -84,7 +84,7 @@ func (daemon *Daemon) SendMotd(client *Client) { } client.ReplyNicknamed("375", "- "+daemon.hostname+" Message of the day -") - for _, s := range bytes.Split(motd, []byte("\n")) { + for _, s := range bytes.Split(bytes.TrimRight(motd, "\n"), []byte("\n")) { client.ReplyNicknamed("372", "- "+string(s)) } client.ReplyNicknamed("376", "End of /MOTD command")