From b0d8e80736cc704523f72e37b41aa65853f82ab6 Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Mon, 14 Oct 2024 23:19:35 +0200 Subject: [PATCH] fix(ssh_config): Improve include behavior --- server/handlers/ssh_config/analyzer/include.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/handlers/ssh_config/analyzer/include.go b/server/handlers/ssh_config/analyzer/include.go index 3be60df..8cb5115 100644 --- a/server/handlers/ssh_config/analyzer/include.go +++ b/server/handlers/ssh_config/analyzer/include.go @@ -26,7 +26,7 @@ func analyzeIncludeValues( ) { for _, include := range ctx.document.Indexes.Includes { for _, value := range include.Values { - if isImpossibleToVerify(value.Value) { + if !canBeAnalyzed(value.Value) { continue } @@ -47,20 +47,20 @@ func analyzeIncludeValues( // We can't evaluate environmental variables or tokens as we don't know the actual // values -func isImpossibleToVerify( +func canBeAnalyzed( path string, ) bool { if environmtalVariablePattern.MatchString(path) { - return true + return false } - for _, token := range fields.AvailableTokens { + for token := range fields.AvailableTokens { if strings.Contains(path, token) { - return true + return false } } - return false + return true } func createIncludePaths(