diff options
author | Andrew Gerrand <adg@golang.org> | 2011-09-08 10:43:40 +1000 |
---|---|---|
committer | Andrew Gerrand <adg@golang.org> | 2011-09-08 10:43:40 +1000 |
commit | cdd4a35fddb728a9bcba3594f0e2447744ac8a05 (patch) | |
tree | 2cae0a0c7ff97079e49d00b71a9cb0e642821d18 | |
parent | ef1721d38864f05245805d840fcdd64d4b4ff457 (diff) | |
download | go-cdd4a35fddb728a9bcba3594f0e2447744ac8a05.tar.gz |
[release-branch.r60] goinstall: error out with paths that end with '/'
??? CL 4807048 / ae3b2b092cf7
goinstall: error out with paths that end with '/'
R=adg, rsc, tarmigan+golang
CC=golang-dev
http://codereview.appspot.com/4807048
Committer: Andrew Gerrand <adg@golang.org>
???
R=golang-dev, dsymonds
CC=golang-dev
http://codereview.appspot.com/4968077
-rw-r--r-- | src/cmd/goinstall/main.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cmd/goinstall/main.go b/src/cmd/goinstall/main.go index 910ab7090..baea260e5 100644 --- a/src/cmd/goinstall/main.go +++ b/src/cmd/goinstall/main.go @@ -182,6 +182,12 @@ func install(pkg, parent string) { visit[pkg] = done }() + // Don't allow trailing '/' + if _, f := filepath.Split(pkg); f == "" { + errorf("%s should not have trailing '/'\n", pkg) + return + } + // Check whether package is local or remote. // If remote, download or update it. tree, pkg, err := build.FindTree(pkg) |