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:
parent
63363f2d49
commit
1942888a9f
1 changed files with 1 additions and 2 deletions
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue