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:
parent
e042d9089f
commit
fd83071b6b
2 changed files with 12 additions and 0 deletions
|
@ -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 = ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue