@@ -42,6 +42,7 @@ import (
4242 "github.com/rclone/rclone/lib/dircache"
4343 "github.com/rclone/rclone/lib/encoder"
4444 "github.com/rclone/rclone/lib/env"
45+ "github.com/rclone/rclone/lib/join"
4546 "github.com/rclone/rclone/lib/oauthutil"
4647 "github.com/rclone/rclone/lib/pacer"
4748 "github.com/rclone/rclone/lib/readers"
@@ -2024,7 +2025,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e
20242025
20252026 var iErr error
20262027 _ , err = f .list (ctx , []string {directoryID }, "" , false , false , f .opt .TrashedOnly , false , func (item * drive.File ) bool {
2027- entry , err := f .itemToDirEntry (ctx , path . Join (dir , item .Name ), item )
2028+ entry , err := f .itemToDirEntry (ctx , join . PathJoin (dir , item .Name ), item )
20282029 if err != nil {
20292030 iErr = err
20302031 return true
@@ -2136,7 +2137,7 @@ func (f *Fs) listRRunner(ctx context.Context, wg *sync.WaitGroup, in chan listRE
21362137 continue
21372138 }
21382139 }
2139- remote := path . Join (paths [i ], item .Name )
2140+ remote := join . PathJoin (paths [i ], item .Name )
21402141 entry , err := f .itemToDirEntry (ctx , remote , item )
21412142 if err != nil {
21422143 iErr = err
@@ -2716,7 +2717,7 @@ func (f *Fs) delete(ctx context.Context, id string, useTrash bool) error {
27162717// purgeCheck removes the dir directory, if check is set then it
27172718// refuses to do so if it has anything in
27182719func (f * Fs ) purgeCheck (ctx context.Context , dir string , check bool ) error {
2719- root := path . Join (f .root , dir )
2720+ root := join . PathJoin (f .root , dir )
27202721 dc := f .dirCache
27212722 directoryID , err := dc .FindDir (ctx , dir , false )
27222723 if err != nil {
@@ -2919,7 +2920,7 @@ func (r cleanupResult) Error() string {
29192920
29202921func (f * Fs ) cleanupTeamDrive (ctx context.Context , dir string , directoryID string ) (r cleanupResult , err error ) {
29212922 _ , err = f .list (ctx , []string {directoryID }, "" , false , false , true , false , func (item * drive.File ) bool {
2922- remote := path . Join (dir , item .Name )
2923+ remote := join . PathJoin (dir , item .Name )
29232924 if item .ExplicitlyTrashed { // description is wrong - can also be set for folders - no need to recurse them
29242925 err := f .delete (ctx , item .Id , false )
29252926 if err != nil {
@@ -3437,7 +3438,7 @@ func (f *Fs) unTrash(ctx context.Context, dir string, directoryID string, recurs
34373438 directoryID = actualID (directoryID )
34383439 fs .Debugf (dir , "finding trash to restore in directory %q" , directoryID )
34393440 _ , err = f .list (ctx , []string {directoryID }, "" , false , false , f .opt .TrashedOnly , true , func (item * drive.File ) bool {
3440- remote := path . Join (dir , item .Name )
3441+ remote := join . PathJoin (dir , item .Name )
34413442 if item .ExplicitlyTrashed {
34423443 fs .Infof (remote , "restoring %q" , item .Id )
34433444 if operations .SkipDestructive (ctx , remote , "restore" ) {
0 commit comments