Merge pull request #6666 from erikh/fix-escaping-whitespace

fix whitespace that precedes the escape in a multiline string.
This commit is contained in:
Tibor Vass 2014-06-25 17:03:19 -04:00
Родитель 01d4fd76dd 03c5c1930d
Коммит b85f20cf13
2 изменённых файлов: 25 добавлений и 1 удалений

Просмотреть файл

@ -1490,3 +1490,27 @@ func TestBuildAddToSymlinkDest(t *testing.T) {
}
logDone("build - add to symlink destination")
}
func TestBuildEscapeWhitespace(t *testing.T) {
name := "testbuildescaping"
defer deleteImages(name)
_, err := buildImage(name, `
FROM busybox
MAINTAINER "Docker \
IO <io@\
docker.com>"
`, true)
res, err := inspectField(name, "Author")
if err != nil {
t.Fatal(err)
}
if res != "Docker IO <io@docker.com>" {
t.Fatal("Parsed string did not match the escaped string")
}
logDone("build - validate escaping whitespace")
}

Просмотреть файл

@ -761,7 +761,7 @@ func (b *buildFile) commit(id string, autoCmd []string, comment string) error {
}
// Long lines can be split with a backslash
var lineContinuation = regexp.MustCompile(`\s*\\\s*\n`)
var lineContinuation = regexp.MustCompile(`\\\s*\n`)
func (b *buildFile) Build(context io.Reader) (string, error) {
tmpdirPath, err := ioutil.TempDir("", "docker-build")