aboutsummaryrefslogtreecommitdiff
path: root/weed/util
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-08-15 01:53:46 -0700
committerChris Lu <chris.lu@gmail.com>2021-08-15 01:53:46 -0700
commit9462f5129a8c6c66200150b41ddfe96a3dd0454e (patch)
tree76c1782fe91d0d6adcb63a6435d217d48fd85f78 /weed/util
parent3ada61c875158dedd24618013da01939cc7acc07 (diff)
downloadseaweedfs-9462f5129a8c6c66200150b41ddfe96a3dd0454e.tar.xz
seaweedfs-9462f5129a8c6c66200150b41ddfe96a3dd0454e.zip
shell: add "remote.meta.sync"
Diffstat (limited to 'weed/util')
-rw-r--r--weed/util/fullpath.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/weed/util/fullpath.go b/weed/util/fullpath.go
index f2119707e..85028b052 100644
--- a/weed/util/fullpath.go
+++ b/weed/util/fullpath.go
@@ -31,10 +31,14 @@ func (fp FullPath) Name() string {
func (fp FullPath) Child(name string) FullPath {
dir := string(fp)
+ noPrefix := name
+ if strings.HasPrefix(name, "/") {
+ noPrefix = name[1:]
+ }
if strings.HasSuffix(dir, "/") {
- return FullPath(dir + name)
+ return FullPath(dir + noPrefix)
}
- return FullPath(dir + "/" + name)
+ return FullPath(dir + "/" + noPrefix)
}
func (fp FullPath) AsInode() uint64 {