aboutsummaryrefslogtreecommitdiff
path: root/weed/util
diff options
context:
space:
mode:
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 {