removed redundant Clean

The doc (or src) says: The result is Cleaned.

http://golang.org/pkg/path/filepath/#Join

Signed-off-by: shuai-z <zs.broccoli@gmail.com>
This commit is contained in:
shuai-z 2014-10-26 13:55:29 +08:00
parent 8e63996484
commit 0ed7e5e7de

View file

@ -35,7 +35,6 @@ func FollowSymlinkInScope(link, root string) (string, error) {
for _, p := range strings.Split(link, "/") {
prev = filepath.Join(prev, p)
prev = filepath.Clean(prev)
loopCounter := 0
for {
@ -72,7 +71,7 @@ func FollowSymlinkInScope(link, root string) (string, error) {
} else {
prev, _ = filepath.Abs(prev)
if prev = filepath.Clean(filepath.Join(filepath.Dir(prev), dest)); len(prev) < len(root) {
if prev = filepath.Join(filepath.Dir(prev), dest); len(prev) < len(root) {
prev = filepath.Join(root, filepath.Base(dest))
}
}