1
mirror of https://github.com/rclone/rclone synced 2024-12-26 18:23:45 +01:00

crypt: correctly handle trailing dot

This commit is contained in:
buengese 2020-01-21 22:32:34 +01:00 committed by buengese
parent 7125cb10f5
commit 9c858c3228

View File

@ -5,6 +5,7 @@ import (
"context"
"fmt"
"io"
"path"
"strings"
"time"
@ -144,6 +145,10 @@ func NewFs(name, rpath string, m configmap.Mapper) (fs.Fs, error) {
if err != nil {
return nil, errors.Wrapf(err, "failed to parse remote %q to wrap", remote)
}
// Make sure to remove trailing . reffering to the current dir
if path.Base(rpath) == "." {
rpath = strings.TrimSuffix(rpath, ".")
}
// Look for a file first
remotePath := fspath.JoinRootPath(wPath, cipher.EncryptFileName(rpath))
wrappedFs, err := wInfo.NewFs(wName, remotePath, wConfig)