Browse code

pkg/archive_windows: make use of os.PathSeparator

cc: @jhowardmsft

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>

Ahmet Alp Balkan authored on 2015/03/06 10:15:11
Showing 1 changed files
... ...
@@ -4,6 +4,7 @@ package archive
4 4
 
5 5
 import (
6 6
 	"fmt"
7
+	"os"
7 8
 	"strings"
8 9
 
9 10
 	"github.com/docker/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar"
... ...
@@ -20,7 +21,8 @@ func CanonicalTarNameForPath(p string) (string, error) {
20 20
 	if strings.Contains(p, "/") {
21 21
 		return "", fmt.Errorf("windows path contains forward slash: %s", p)
22 22
 	}
23
-	return strings.Replace(p, "\\", "/", -1), nil
23
+	return strings.Replace(p, string(os.PathSeparator), "/", -1), nil
24
+
24 25
 }
25 26
 
26 27
 func setHeaderForSpecialDevice(hdr *tar.Header, ta *tarAppender, name string, stat interface{}) (nlink uint32, inode uint64, err error) {