fix: persist ignoreMatchDirective to included file (#6)

The ignoreMatchDirective flag did not exist in the newConfig function.
Because this function is called when generating a config for connections
in an included file, those connections automatically assumed the value
was false. This change adds the flag so it can be changed to true if it
is also set for the outer configuration.
This commit is contained in:
Sylvie Crowe
2024-12-19 12:37:47 -08:00
committed by GitHub
parent ed12436768
commit 6409e4292f
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -861,8 +861,9 @@ func init() {
}
}
func newConfig() *Config {
func newConfig(ignoreMatchDirective bool) *Config {
return &Config{
ignoreMatchDirective: ignoreMatchDirective,
Hosts: []*Host{
&Host{
implicit: true,
+1 -1
View File
@@ -187,7 +187,7 @@ func parseSSH(flow chan token, system, ignoreMatchDirective bool, depth uint8) *
}
}()
result := newConfig()
result := newConfig(ignoreMatchDirective)
result.position = Position{1, 1}
parser := &sshParser{
ignoreMatchDirective: ignoreMatchDirective,