aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/kevinburke/ssh_config/parser.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/kevinburke/ssh_config/parser.go')
-rw-r--r--vendor/github.com/kevinburke/ssh_config/parser.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/vendor/github.com/kevinburke/ssh_config/parser.go b/vendor/github.com/kevinburke/ssh_config/parser.go
index 02745b4b29..36c42055f5 100644
--- a/vendor/github.com/kevinburke/ssh_config/parser.go
+++ b/vendor/github.com/kevinburke/ssh_config/parser.go
@@ -149,7 +149,7 @@ func (p *sshParser) parseKV() sshParserStateFn {
Value: val.val,
Comment: comment,
hasEquals: hasEquals,
- leadingSpace: uint16(key.Position.Col) - 1,
+ leadingSpace: key.Position.Col - 1,
position: key.Position,
}
lastHost.Nodes = append(lastHost.Nodes, kv)
@@ -169,6 +169,12 @@ func (p *sshParser) parseComment() sshParserStateFn {
}
func parseSSH(flow chan token, system bool, depth uint8) *Config {
+ // Ensure we consume tokens to completion even if parser exits early
+ defer func() {
+ for range flow {
+ }
+ }()
+
result := newConfig()
result.position = Position{1, 1}
parser := &sshParser{