diff options
author | Jani Monoses <jani.monoses@ubuntu.com> | 2011-11-04 15:07:34 -0400 |
---|---|---|
committer | Jani Monoses <jani.monoses@ubuntu.com> | 2011-11-04 15:07:34 -0400 |
commit | 6da71583105287cf4024fb014a6ce7c54c537743 (patch) | |
tree | 97a397488a8fdada1ed025b16f875afb429b4c9a | |
parent | ab390dbd64c834f649417cfef5d49bffce6f2ec2 (diff) | |
download | go-6da71583105287cf4024fb014a6ce7c54c537743.tar.gz |
goinstall: allow packages from launchpad.net/~user branches.
The permitted filename characters should include ~ to allow
the names of user-owned branches in Launchpad.
R=golang-dev, rsc, n13m3y3r, gustavo
CC=golang-dev, gustavo.niemeyer
http://codereview.appspot.com/5280052
Committer: Gustavo Niemeyer <gustavo@niemeyer.net>
-rw-r--r-- | src/cmd/goinstall/make.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmd/goinstall/make.go b/src/cmd/goinstall/make.go index c724cda47..7445c9c20 100644 --- a/src/cmd/goinstall/make.go +++ b/src/cmd/goinstall/make.go @@ -109,7 +109,7 @@ func makeMakefile(dir, pkg string, tree *build.Tree, isCmd bool) ([]byte, error) return buf.Bytes(), nil } -var safeBytes = []byte("+-./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz") +var safeBytes = []byte("+-~./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz") func safeName(s string) bool { if s == "" { @@ -118,6 +118,9 @@ func safeName(s string) bool { if strings.Contains(s, "..") { return false } + if s[0] == '~' { + return false + } for i := 0; i < len(s); i++ { if c := s[i]; c < 0x80 && bytes.IndexByte(safeBytes, c) < 0 { return false |