1
0
mirror of https://github.com/docker/cli.git synced 2026-01-13 18:22:35 +03:00

Merge pull request #2355 from thaJeztah/fix_bind_panic

fix panic on single-character volumes
This commit is contained in:
Silvin Lubecki
2020-02-21 14:48:37 +01:00
committed by GitHub
2 changed files with 5 additions and 0 deletions

View File

@@ -111,6 +111,9 @@ func isFilePath(source string) bool {
case '.', '/', '~':
return true
}
if len([]rune(source)) == 1 {
return false
}
// windows named pipes
if strings.HasPrefix(source, `\\`) {

View File

@@ -162,6 +162,8 @@ func TestParseVolumeWindowsNamedPipe(t *testing.T) {
func TestIsFilePath(t *testing.T) {
assert.Check(t, !isFilePath("a界"))
assert.Check(t, !isFilePath("1"))
assert.Check(t, !isFilePath("c"))
}
// Preserve the test cases for VolumeSplitN