From 0c1ee8b84de5f56cd9a425ddb017f9f44f5df7df Mon Sep 17 00:00:00 2001 From: Sylvia Crowe Date: Thu, 19 Dec 2024 12:26:35 -0800 Subject: [PATCH] fix: persist ignoreMatchDirective to included file 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. --- config.go | 3 ++- parser.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config.go b/config.go index 533b460..7b82b1b 100644 --- a/config.go +++ b/config.go @@ -861,8 +861,9 @@ func init() { } } -func newConfig() *Config { +func newConfig(ignoreMatchDirective bool) *Config { return &Config{ + ignoreMatchDirective: ignoreMatchDirective, Hosts: []*Host{ &Host{ implicit: true, diff --git a/parser.go b/parser.go index ed30810..e61feb5 100644 --- a/parser.go +++ b/parser.go @@ -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,