2018-02-05 16:05:59 -05:00
|
|
|
package containerfs // import "github.com/docker/docker/pkg/containerfs"
|
2017-08-03 20:22:00 -04:00
|
|
|
|
|
|
|
import "path/filepath"
|
|
|
|
|
2022-09-22 20:17:25 -04:00
|
|
|
// CleanScopedPath removes the C:\ syntax, and prepares to combine
|
2017-08-03 20:22:00 -04:00
|
|
|
// with a volume path
|
2022-09-22 20:17:25 -04:00
|
|
|
func CleanScopedPath(path string) string {
|
2017-08-03 20:22:00 -04:00
|
|
|
if len(path) >= 2 {
|
|
|
|
c := path[0]
|
|
|
|
if path[1] == ':' && ('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') {
|
|
|
|
path = path[2:]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return filepath.Join(string(filepath.Separator), path)
|
|
|
|
}
|