aboutsummaryrefslogtreecommitdiff
path: root/weed/util/fullpath.go
diff options
context:
space:
mode:
authorshibinbin <shibinbin@megvii.com>2020-10-28 11:36:42 +0800
committershibinbin <shibinbin@megvii.com>2020-10-28 11:36:42 +0800
commit7cc07655d493d11c967cfa978ddc5181d4b6b861 (patch)
tree5ae5bcf7ccc3cee3c55372674753d7c1ca48dff9 /weed/util/fullpath.go
parent29a4c3944eeb07434060df52dfb1d3cf4c59dc91 (diff)
parent53c3aad87528d57343afc5fdb3fb5107544af0fc (diff)
downloadseaweedfs-7cc07655d493d11c967cfa978ddc5181d4b6b861.tar.xz
seaweedfs-7cc07655d493d11c967cfa978ddc5181d4b6b861.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'weed/util/fullpath.go')
-rw-r--r--weed/util/fullpath.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/weed/util/fullpath.go b/weed/util/fullpath.go
index 4ce8a2f90..f2119707e 100644
--- a/weed/util/fullpath.go
+++ b/weed/util/fullpath.go
@@ -13,6 +13,7 @@ func NewFullPath(dir, name string) FullPath {
func (fp FullPath) DirAndName() (string, string) {
dir, name := filepath.Split(string(fp))
+ name = strings.ToValidUTF8(name, "?")
if dir == "/" {
return dir, name
}
@@ -24,6 +25,7 @@ func (fp FullPath) DirAndName() (string, string) {
func (fp FullPath) Name() string {
_, name := filepath.Split(string(fp))
+ name = strings.ToValidUTF8(name, "?")
return name
}