aboutsummaryrefslogtreecommitdiff
path: root/script.go
diff options
context:
space:
mode:
Diffstat (limited to 'script.go')
-rw-r--r--script.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/script.go b/script.go
index 0d0b1b1..dd54eac 100644
--- a/script.go
+++ b/script.go
@@ -197,12 +197,13 @@ func joinStatements(in [][]byte) (out [][]byte) {
continue
}
- stmt = bytes.TrimRight(stmt, "\\ \t")
- stmt = append(stmt, ' ')
+ // Start joining multiline statement.
+
+ stmt = bytes.TrimRight(stmt, "\\")
y = x + 1
for ; y < len(in); y++ {
- nextStmt = bytes.TrimSpace(in[y])
+ nextStmt = in[y]
if len(nextStmt) == 0 {
in[y] = nil
out[y] = nil
@@ -213,10 +214,8 @@ func joinStatements(in [][]byte) (out [][]byte) {
lastc = nextStmt[endc]
if lastc == '\\' {
- nextStmt = bytes.TrimRight(nextStmt, "\\ \t")
- nextStmt = append(nextStmt, ' ')
+ nextStmt = bytes.TrimRight(nextStmt, "\\")
}
-
stmt = append(stmt, nextStmt...)
in[y] = nil