1
mirror of https://github.com/rclone/rclone synced 2024-12-25 17:03:45 +01:00

uptobox: fix root path handling - fixes #5903

This commit is contained in:
buengese 2022-06-12 21:35:26 +02:00 committed by Sebastian Bünger
parent cee79f27ee
commit 3a20929db4

View File

@ -163,7 +163,7 @@ func (f *Fs) splitPathFull(pth string) (string, string) {
}
// splitPath is modified splitPath version that doesn't include the seperator
// in the base part
// in the base path
func (f *Fs) splitPath(pth string) (string, string) {
// chop of any leading or trailing '/'
pth = strings.Trim(pth, "/")
@ -201,7 +201,11 @@ func NewFs(ctx context.Context, name string, root string, config configmap.Mappe
opt: *opt,
pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant), pacer.AttackConstant(attackConstant))),
}
f.root = root
if root == "/" || root == "." {
f.root = ""
} else {
f.root = root
}
f.features = (&fs.Features{
DuplicateFiles: true,
CanHaveEmptyDirectories: true,