From b94b2a3723e27cfda1a483245e805f48c9caaa9b Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 2 Oct 2019 12:41:52 +0100 Subject: [PATCH] mega: fix after lib/encoder change --- backend/mega/mega.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/mega/mega.go b/backend/mega/mega.go index 42d5b4579..efa3ddabb 100644 --- a/backend/mega/mega.go +++ b/backend/mega/mega.go @@ -252,12 +252,11 @@ func NewFs(name, root string, m configmap.Mapper) (fs.Fs, error) { // It also encodes the parts into backend specific encoding func splitNodePath(nodePath string) (parts []string) { nodePath = path.Clean(nodePath) - nodePath = enc.FromStandardPath(nodePath) - parts = strings.Split(nodePath, "/") - if len(parts) == 1 && (parts[0] == "." || parts[0] == "/") { + if nodePath == "." || nodePath == "/" { return nil } - return parts + nodePath = enc.FromStandardPath(nodePath) + return strings.Split(nodePath, "/") } // findNode looks up the node for the path of the name given from the root given