Revert "Require continuation char to be last char in a line"
| ... | ... |
@@ -61,7 +61,7 @@ func SetEscapeToken(s string, d *Directive) error {
|
| 61 | 61 |
return fmt.Errorf("invalid ESCAPE '%s'. Must be ` or \\", s)
|
| 62 | 62 |
} |
| 63 | 63 |
d.EscapeToken = rune(s[0]) |
| 64 |
- d.LineContinuationRegex = regexp.MustCompile(`\` + s + `$`) |
|
| 64 |
+ d.LineContinuationRegex = regexp.MustCompile(`\` + s + `[ \t]*$`) |
|
| 65 | 65 |
return nil |
| 66 | 66 |
} |
| 67 | 67 |
|
| ... | ... |
@@ -7037,17 +7037,6 @@ func (s *DockerSuite) TestBuildCmdShellArgsEscaped(c *check.C) {
|
| 7037 | 7037 |
} |
| 7038 | 7038 |
} |
| 7039 | 7039 |
|
| 7040 |
-func (s *DockerSuite) TestContinueCharSpace(c *check.C) {
|
|
| 7041 |
- // Test to make sure that we don't treat a \ as a continuation |
|
| 7042 |
- // character IF there are spaces (or tabs) after it on the same line |
|
| 7043 |
- name := "testbuildcont" |
|
| 7044 |
- _, err := buildImage(name, "FROM busybox\nRUN echo hi \\\t\nbye", true) |
|
| 7045 |
- c.Assert(err, check.NotNil, check.Commentf("Build 1 should fail - didn't"))
|
|
| 7046 |
- |
|
| 7047 |
- _, err = buildImage(name, "FROM busybox\nRUN echo hi \\ \nbye", true) |
|
| 7048 |
- c.Assert(err, check.NotNil, check.Commentf("Build 2 should fail - didn't"))
|
|
| 7049 |
-} |
|
| 7050 |
- |
|
| 7051 | 7040 |
// Test case for #24912. |
| 7052 | 7041 |
func (s *DockerSuite) TestBuildStepsWithProgress(c *check.C) {
|
| 7053 | 7042 |
name := "testbuildstepswithprogress" |