diff --git a/irc/commands.go b/irc/commands.go index 2a75324c..6ccbe35d 100644 --- a/irc/commands.go +++ b/irc/commands.go @@ -101,9 +101,11 @@ func parseLine(line string) (StringCode, []string) { var parts []string if colonIndex := strings.IndexRune(line, ':'); colonIndex >= 0 { lastArg := norm.NFC.String(line[colonIndex+len(":"):]) - line = norm.NFKC.String(line[:colonIndex-len(" ")]) + line = strings.TrimRight(line[:colonIndex], " ") + line = norm.NFKC.String(line) parts = append(spacesExpr.Split(line, -1), lastArg) } else { + line = strings.TrimRight(line, " ") line = norm.NFKC.String(line) parts = spacesExpr.Split(line, -1) } diff --git a/irc/constants.go b/irc/constants.go index 20e07b17..a03cf77c 100644 --- a/irc/constants.go +++ b/irc/constants.go @@ -23,7 +23,7 @@ var ( ) const ( - SEM_VER = "ergonomadic-1.2.7" + SEM_VER = "ergonomadic-1.2.8" CRLF = "\r\n" MAX_REPLY_LEN = 512 - len(CRLF) diff --git a/irc/socket.go b/irc/socket.go index a93e7a5b..48a663e9 100644 --- a/irc/socket.go +++ b/irc/socket.go @@ -53,7 +53,7 @@ func (socket *Socket) readLines(commands chan<- editableCommand) { if socket.isError(err, R) { break } - line = strings.TrimRight(line, "\r\n") + line = strings.TrimRight(line, CRLF) if len(line) == 0 { continue }