]> Cypherpunks repositories - gostls13.git/commitdiff
goinstall: error out with paths that end with '/'
authorTarmigan Casebolt <tarmigan@gmail.com>
Sun, 21 Aug 2011 10:28:29 +0000 (20:28 +1000)
committerAndrew Gerrand <adg@golang.org>
Sun, 21 Aug 2011 10:28:29 +0000 (20:28 +1000)
R=adg, rsc, tarmigan+golang
CC=golang-dev
https://golang.org/cl/4807048

src/cmd/goinstall/main.go

index 910ab7090a47c1962d057c165a7dd4ec0e0d7798..baea260e56ca883ad14afcce4f97b40af82c0c97 100644 (file)
@@ -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)