From 6409e4292f34a7b68095db0a88e0a75fbc86a0b3 Mon Sep 17 00:00:00 2001 From: Sylvie Crowe <107814465+oneirocosm@users.noreply.github.com> Date: Thu, 19 Dec 2024 12:37:47 -0800 Subject: [PATCH] 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. --- 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,