fix(repo): clean the path before using it
no issue detected but it's good to be safe
Brian Tiger Chow committed
Jan 13, 2015 at 17:27 UTC
76202a94442e1fdf95dae6da3e0c766c31ed5b13
1 file changed
+3
-2
repo/fsrepo/fsrepo.go
+3
-2
@@ -5,6 +5,7 @@ import (
5
"fmt"
6
"io"
7
"os"
8
+ "path"
9
"path/filepath"
10
11
repo "github.com/jbenet/go-ipfs/repo"
@@ -42,10 +43,10 @@ type FSRepo struct {
43
}
44
45
// At returns a handle to an FSRepo at the provided |path|.
45
-func At(path string) *FSRepo {
46
+func At(repoPath string) *FSRepo {
47
// This method must not have side-effects.
48
return &FSRepo{
48
- path: path,
49
+ path: path.Clean(repoPath),
50
state: unopened, // explicitly set for clarity
51
}
52
}