mirror of
https://github.com/rclone/rclone.git
synced 2025-08-09 13:55:15 +02:00
rc: fix operations/stat with trailing /
Before this change using operations/stat with a remote pointing to a dir with a trailing / would return a null output rather than the correct info. This was because the directory was not found with a trailing slash in the directory listing. Fixes #6817
This commit is contained in:
@ -314,6 +314,9 @@ func StatJSON(ctx context.Context, fsrc fs.Fs, remote string, opt *ListJSONOpt)
|
||||
}
|
||||
}
|
||||
// Must be a directory here
|
||||
//
|
||||
// Remove trailing / as rclone listings won't have them
|
||||
remote = strings.TrimRight(remote, "/")
|
||||
parent := path.Dir(remote)
|
||||
if parent == "." || parent == "/" {
|
||||
parent = ""
|
||||
|
Reference in New Issue
Block a user