From 76202a94442e1fdf95dae6da3e0c766c31ed5b13 Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Tue, 13 Jan 2015 17:27:52 -0800 Subject: [PATCH] fix(repo): clean the path before using it no issue detected but it's good to be safe --- repo/fsrepo/fsrepo.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/repo/fsrepo/fsrepo.go b/repo/fsrepo/fsrepo.go index 877578770..c8cfd91d9 100644 --- a/repo/fsrepo/fsrepo.go +++ b/repo/fsrepo/fsrepo.go @@ -5,6 +5,7 @@ import ( "fmt" "io" "os" + "path" "path/filepath" repo "github.com/jbenet/go-ipfs/repo" @@ -42,10 +43,10 @@ type FSRepo struct { } // At returns a handle to an FSRepo at the provided |path|. -func At(path string) *FSRepo { +func At(repoPath string) *FSRepo { // This method must not have side-effects. return &FSRepo{ - path: path, + path: path.Clean(repoPath), state: unopened, // explicitly set for clarity } }