Skip to content

Conversation

lonnywong
Copy link

e.g., Include ~/other/config on Linux, Include ~\other\config on Windows.

e.g., `Include ~/other/config` on Linux, `Include ~\other\config` on Windows.
} 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 ~\.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants