Expand ~/ on Windows as well

This commit is contained in:
Jakob Borg
2014-05-24 13:22:09 +02:00
parent ed07fc0f2c
commit 8661afcb4f
2 changed files with 6 additions and 2 deletions

View File

@@ -679,7 +679,11 @@ func getDefaultConfDir() string {
}
func expandTilde(p string) string {
if runtime.GOOS == "windows" || !strings.HasPrefix(p, "~/") {
if p == "~" {
return getHomeDir()
}
if !strings.HasPrefix(p, fmt.Sprintf("~%c", os.PathSeparator)) {
return p
}