mirror of
https://github.com/rclone/rclone
synced 2024-12-24 15:43:45 +01:00
vfs/cache: fix handling of special characters in file names (#5875)
This commit is contained in:
parent
06bdf7c64c
commit
4b99e84242
@ -196,7 +196,6 @@ func createRootDirs(parentOSPath string, relativeDirOSPath string) (dataOSPath s
|
|||||||
// Returns an os path for the data cache file.
|
// Returns an os path for the data cache file.
|
||||||
func (c *Cache) createItemDir(name string) (string, error) {
|
func (c *Cache) createItemDir(name string) (string, error) {
|
||||||
parent := vfscommon.FindParent(name)
|
parent := vfscommon.FindParent(name)
|
||||||
leaf := filepath.Base(name)
|
|
||||||
parentPath := c.toOSPath(parent)
|
parentPath := c.toOSPath(parent)
|
||||||
err := createDir(parentPath)
|
err := createDir(parentPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -207,7 +206,7 @@ func (c *Cache) createItemDir(name string) (string, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("failed to create metadata cache item directory: %w", err)
|
return "", fmt.Errorf("failed to create metadata cache item directory: %w", err)
|
||||||
}
|
}
|
||||||
return filepath.Join(parentPath, leaf), nil
|
return c.toOSPath(name), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// getBackend gets a backend for a cache root dir
|
// getBackend gets a backend for a cache root dir
|
||||||
|
Loading…
Reference in New Issue
Block a user