Commit 380337b7 authored by Matt Bell's avatar Matt Bell

commands/cli: Use filepath.Join for file path building

parent 015bd06c
...@@ -5,6 +5,7 @@ import ( ...@@ -5,6 +5,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"os" "os"
fp "path/filepath"
"strings" "strings"
cmds "github.com/jbenet/go-ipfs/commands" cmds "github.com/jbenet/go-ipfs/commands"
...@@ -281,7 +282,7 @@ func getFile(file *os.File, path string) (cmds.File, error) { ...@@ -281,7 +282,7 @@ func getFile(file *os.File, path string) (cmds.File, error) {
files := make([]cmds.File, 0, len(contents)) files := make([]cmds.File, 0, len(contents))
for _, child := range contents { for _, child := range contents {
childPath := fmt.Sprintf("%s/%s", path, child.Name()) childPath := fp.Join(path, child.Name())
childFile, err := os.Open(childPath) childFile, err := os.Open(childPath)
if err != nil { if err != nil {
return nil, err return nil, err
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment