net: reject invalid net:proto network names

R=rsc
CC=golang-dev
https://golang.org/cl/4129042
This commit is contained in:
Olivier Antoine 2011-02-16 15:03:47 -05:00 committed by Russ Cox
parent acad4e0cf9
commit df4b22fcff
3 changed files with 19 additions and 23 deletions

View file

@ -192,16 +192,6 @@ func count(s string, b byte) int {
return n
}
// Returns the prefix of s up to but not including the character c
func prefixBefore(s string, c byte) string {
for i, v := range s {
if v == int(c) {
return s[0:i]
}
}
return s
}
// Index of rightmost occurrence of b in s.
func last(s string, b byte) int {
i := len(s)