Gofix for r59.

This commit is contained in:
Alex Bramley 2011-08-03 08:03:08 +01:00
parent 43a2bf08f1
commit 1a4ce96e00
1 changed files with 2 additions and 3 deletions

View File

@ -42,7 +42,7 @@ func parseLine(s string) *Line {
nidx, uidx := strings.Index(line.Src, "!"), strings.Index(line.Src, "@") nidx, uidx := strings.Index(line.Src, "!"), strings.Index(line.Src, "@")
if uidx != -1 && nidx != -1 { if uidx != -1 && nidx != -1 {
line.Nick = line.Src[:nidx] line.Nick = line.Src[:nidx]
line.Ident = line.Src[nidx+1:uidx] line.Ident = line.Src[nidx+1 : uidx]
line.Host = line.Src[uidx+1:] line.Host = line.Src[uidx+1:]
} }
} }
@ -68,7 +68,7 @@ func parseLine(s string) *Line {
strings.HasPrefix(line.Args[1], "\001") && strings.HasPrefix(line.Args[1], "\001") &&
strings.HasSuffix(line.Args[1], "\001") { strings.HasSuffix(line.Args[1], "\001") {
// WOO, it's a CTCP message // WOO, it's a CTCP message
t := strings.Split(strings.Trim(line.Args[1], "\001"), " ", 2) t := strings.SplitN(strings.Trim(line.Args[1], "\001"), " ", 2)
if len(t) > 1 { if len(t) > 1 {
// Replace the line with the unwrapped CTCP // Replace the line with the unwrapped CTCP
line.Args[1] = t[1] line.Args[1] = t[1]
@ -85,4 +85,3 @@ func parseLine(s string) *Line {
} }
return line return line
} }