From f66928a846198778b52c75b45737de4d33d6cc54 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 1 Feb 2021 15:17:25 +0000 Subject: [PATCH] drive: fix copyid command with a bare filename: can't use empty string as a path Before this change, running rclone backend copyid drive: ID file.txt Failed with the error command "copyid" failed: failed copying "ID" "file.txt": can't use empty string as a path This fixes the problem. --- backend/drive/drive.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/drive/drive.go b/backend/drive/drive.go index eab0c3bba..43e43a986 100755 --- a/backend/drive/drive.go +++ b/backend/drive/drive.go @@ -3064,6 +3064,9 @@ func (f *Fs) copyID(ctx context.Context, id, dest string) (err error) { if destLeaf == "" { destLeaf = info.Name } + if destDir == "" { + destDir = "." + } dstFs, err := cache.Get(ctx, destDir) if err != nil { return err