Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,8 @@ func NewInclude(directives []string, hasEquals bool, pos Position, comment strin
path = directives[i]
} else if system {
path = filepath.Join("/etc/ssh", directives[i])
} else if strings.HasPrefix(directives[i], "~/") || strings.HasPrefix(directives[i], "~\\") {
path = filepath.Join(homedir(), directives[i][2:])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 2: right here? Wouldn't it be different in the first condition (only 2 chars) vs. the second condition (3 chars) ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second one is 2 chars. The first \ of \\ is the escape char for \. "~\\" in source code means ~\.

} else {
path = filepath.Join(homedir(), ".ssh", directives[i])
}
Expand Down