Merge pull request #8782 from shuai-z/rm-clean

removed redundant Clean
This commit is contained in:
Jessie Frazelle 2014-10-27 09:23:10 -07:00
commit 77437c3984

View file

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