diff options
Diffstat (limited to 'vendor/github.com/kballard/go-shellquote/unquote.go')
-rw-r--r-- | vendor/github.com/kballard/go-shellquote/unquote.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/github.com/kballard/go-shellquote/unquote.go b/vendor/github.com/kballard/go-shellquote/unquote.go index ba3a0f2271..b1b13da932 100644 --- a/vendor/github.com/kballard/go-shellquote/unquote.go +++ b/vendor/github.com/kballard/go-shellquote/unquote.go @@ -40,6 +40,18 @@ func Split(input string) (words []string, err error) { if strings.ContainsRune(splitChars, c) { input = input[l:] continue + } else if c == escapeChar { + // Look ahead for escaped newline so we can skip over it + next := input[l:] + if len(next) == 0 { + err = UnterminatedEscapeError + return + } + c2, l2 := utf8.DecodeRuneInString(next) + if c2 == '\n' { + input = next[l2:] + continue + } } var word string |