1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Revert "Require continuation char to be last char in a line"

This reverts commit 105bc63295,
which (although correct), resulted in a backward incompatible
change.

We can re-implement this in future, after this changes goes
through a deprecation cycle

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2017-01-10 00:41:03 +01:00
parent 8563492eef
commit c67550414b
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
4 changed files with 4 additions and 12 deletions

View file

@ -61,7 +61,7 @@ func SetEscapeToken(s string, d *Directive) error {
return fmt.Errorf("invalid ESCAPE '%s'. Must be ` or \\", s)
}
d.EscapeToken = rune(s[0])
d.LineContinuationRegex = regexp.MustCompile(`\` + s + `$`)
d.LineContinuationRegex = regexp.MustCompile(`\` + s + `[ \t]*$`)
return nil
}

View file

@ -13,6 +13,8 @@ world
RUN echo hello \
goodbye\
frog
RUN echo hello \
world
RUN echo hi \
\
world \

View file

@ -3,6 +3,7 @@
(run "echo hello world")
(run "echo hello world")
(run "echo hello goodbyefrog")
(run "echo hello world")
(run "echo hi world goodnight")
(run "echo goodbyefrog")
(run "echo goodbyefrog")

View file

@ -7043,17 +7043,6 @@ 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"