1
0
mirror of https://github.com/moby/moby.git synced 2025-07-29 07:21:35 +03:00

Require continuation char to be last char in a line

While look at #27039 I noticed that we allow for whitespace after
the continuation char (\\) which is wrong. It needs to be the very
last char in the line.

Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
Doug Davis
2016-10-04 09:38:00 -07:00
parent 694ba71e36
commit 105bc63295
4 changed files with 12 additions and 4 deletions

View File

@ -6901,6 +6901,17 @@ func (s *DockerSuite) TestBuildCmdShellArgsEscaped(c *check.C) {
}
}
func (s *DockerSuite) TestContinueCharSpace(c *check.C) {
// Test to make sure that we don't treat a \ as a continuation
// character IF there are spaces (or tabs) after it on the same line
name := "testbuildcont"
_, err := buildImage(name, "FROM busybox\nRUN echo hi \\\t\nbye", true)
c.Assert(err, check.NotNil, check.Commentf("Build 1 should fail - didn't"))
_, err = buildImage(name, "FROM busybox\nRUN echo hi \\ \nbye", true)
c.Assert(err, check.NotNil, check.Commentf("Build 2 should fail - didn't"))
}
// Test case for #24912.
func (s *DockerSuite) TestBuildStepsWithProgress(c *check.C) {
name := "testbuildstepswithprogress"