Skip to content

Commit

Permalink
Merge pull request #79 from flynn/target-path
Browse files Browse the repository at this point in the history
util: Use path instead of filepath for NormalizePath
  • Loading branch information
titanous committed Mar 25, 2015
2 parents 8652ae8 + 9f92709 commit a13801a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"hash"
"io"
"io/ioutil"
"path"
"path/filepath"
"strings"

Expand Down Expand Up @@ -104,11 +105,11 @@ func GenerateFileMeta(r io.Reader, hashAlgorithms ...string) (data.FileMeta, err
return m, nil
}

func NormalizeTarget(path string) string {
if path == "" {
func NormalizeTarget(p string) string {
if p == "" {
return "/"
}
s := filepath.Clean(path)
s := path.Clean(p)
if strings.HasPrefix(s, "/") {
return s
}
Expand Down

0 comments on commit a13801a

Please sign in to comment.