forked from TrueCloudLab/rclone
Normalise path names for OSX local filesystem
Fixes #194 Fixes #451 Fixes #463
This commit is contained in:
parent
1752ee3c8b
commit
7c01bbddf8
3 changed files with 21 additions and 0 deletions
|
@ -100,6 +100,7 @@ func (f *Fs) String() string {
|
||||||
|
|
||||||
// newFsObject makes a half completed Object
|
// newFsObject makes a half completed Object
|
||||||
func (f *Fs) newFsObject(remote string) *Object {
|
func (f *Fs) newFsObject(remote string) *Object {
|
||||||
|
remote = normString(remote)
|
||||||
remote = filepath.ToSlash(remote)
|
remote = filepath.ToSlash(remote)
|
||||||
dstPath := f.filterPath(filepath.Join(f.root, f.cleanUtf8(remote)))
|
dstPath := f.filterPath(filepath.Join(f.root, f.cleanUtf8(remote)))
|
||||||
return &Object{
|
return &Object{
|
||||||
|
|
12
local/normalise_darwin.go
Normal file
12
local/normalise_darwin.go
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
// +build darwin
|
||||||
|
|
||||||
|
package local
|
||||||
|
|
||||||
|
import (
|
||||||
|
"golang.org/x/text/unicode/norm"
|
||||||
|
)
|
||||||
|
|
||||||
|
// normString normalises the remote name as some OS X denormalises UTF-8 when storing it to disk
|
||||||
|
func normString(remote string) string {
|
||||||
|
return norm.NFC.String(remote)
|
||||||
|
}
|
8
local/normalise_other.go
Normal file
8
local/normalise_other.go
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
// +build !darwin
|
||||||
|
|
||||||
|
package local
|
||||||
|
|
||||||
|
// normString normalises the remote name if necessary
|
||||||
|
func normString(remote string) string {
|
||||||
|
return remote
|
||||||
|
}
|
Loading…
Reference in a new issue