]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/file_path.go
Fix failing tests
[rbdr/mobius] / hotline / file_path.go
index c8fe652e878aa559e67bae2e9d3d59a1f89a4d35..460af03464cc2e5376769a30f2a1b5951cb4d785 100644 (file)
@@ -76,15 +76,6 @@ func (fp *FilePath) Len() uint16 {
        return binary.BigEndian.Uint16(fp.ItemCount[:])
 }
 
        return binary.BigEndian.Uint16(fp.ItemCount[:])
 }
 
-func (fp *FilePath) String() string {
-       out := []string{"/"}
-       for _, i := range fp.Items {
-               out = append(out, string(i.Name))
-       }
-
-       return filepath.Join(out...)
-}
-
 func readPath(fileRoot string, filePath, fileName []byte) (fullPath string, err error) {
        var fp FilePath
        if filePath != nil {
 func readPath(fileRoot string, filePath, fileName []byte) (fullPath string, err error) {
        var fp FilePath
        if filePath != nil {
@@ -93,10 +84,14 @@ func readPath(fileRoot string, filePath, fileName []byte) (fullPath string, err
                }
        }
 
                }
        }
 
+       var subPath string
+       for _, pathItem := range fp.Items {
+               subPath = filepath.Join("/", subPath, string(pathItem.Name))
+       }
+
        fullPath = filepath.Join(
        fullPath = filepath.Join(
-               "/",
                fileRoot,
                fileRoot,
-               fp.String(),
+               subPath,
                filepath.Join("/", string(fileName)),
        )
 
                filepath.Join("/", string(fileName)),
        )