aboutsummaryrefslogtreecommitdiff
path: root/hotline/file_transfer.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2022-06-20 22:21:28 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2022-06-20 22:21:28 -0700
commitf22acf38da970aa0d865a9978c9499dad01d235f (patch)
tree6811766749c794afd9eb23e372cc1673f1bae41a /hotline/file_transfer.go
parent7cd900d61edbd6d322db3cecb913adf574389320 (diff)
Convert hardcoded path separators to filepath.Join
Diffstat (limited to 'hotline/file_transfer.go')
-rw-r--r--hotline/file_transfer.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/hotline/file_transfer.go b/hotline/file_transfer.go
index 4a93390..90dbbe6 100644
--- a/hotline/file_transfer.go
+++ b/hotline/file_transfer.go
@@ -3,7 +3,7 @@ package hotline
import (
"encoding/binary"
"fmt"
- "strings"
+ "path/filepath"
)
// File transfer types
@@ -51,11 +51,12 @@ func (fu *folderUpload) FormattedPath() string {
var pathSegments []string
pathData := fu.FileNamePath
+ // TODO: implement scanner interface instead?
for i := uint16(0); i < pathItemLen; i++ {
segLen := pathData[2]
pathSegments = append(pathSegments, string(pathData[3:3+segLen]))
pathData = pathData[3+segLen:]
}
- return strings.Join(pathSegments, pathSeparator)
+ return filepath.Join(pathSegments...)
}