File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -49,9 +49,15 @@ const (
49
49
var (
50
50
// Find the first Host and Match statement as these restrict the
51
51
// following declarations to be used conditionally.
52
- sshHostRe = regexp .MustCompile (`(?m)^\s*((?i)Host|Match)\s.*$` )
53
- // Find the semantically correct include statement.
54
- sshCoderIncludedRe = regexp .MustCompile (`(?m)^\s*((?i)Include) coder(\s.*)?$` )
52
+ sshHostRe = regexp .MustCompile (`(?m)^[\t ]*((?i)Host|Match)\s[^\n\r]*$` )
53
+ // Find the semantically correct include statement. Since the user can
54
+ // modify their configuration as they see fit, there could be:
55
+ // - Leading indentation (space, tab)
56
+ // - Trailing indentation (space, tab), followed by e.g. a comment or
57
+ // another file to Include (we don't want to support this, but
58
+ // explicitly blocking it adds complexity)
59
+ // - Select newline after Include statement for removal purposes
60
+ sshCoderIncludedRe = regexp .MustCompile (`(?m)^[\t ]*((?i)Include) coder([\t ].*)?[\r]?[\n]?$` )
55
61
)
56
62
57
63
// sshCoderConfigOptions represents options that can be stored and read
You can’t perform that action at this time.
0 commit comments