Fixes #1062
Séra Zoltán authored 3 years ago
Márk Sági-Kazár committed 2 years ago
94 | 94 | inPath = userHomeDir() + inPath[5:] |
95 | 95 | } |
96 | 96 | |
97 | if strings.HasPrefix(inPath, "$") { | |
98 | end := strings.Index(inPath, string(os.PathSeparator)) | |
99 | ||
100 | var value, suffix string | |
101 | if end == -1 { | |
102 | value = os.Getenv(inPath[1:]) | |
103 | } else { | |
104 | value = os.Getenv(inPath[1:end]) | |
105 | suffix = inPath[end:] | |
106 | } | |
107 | ||
108 | inPath = value + suffix | |
109 | } | |
97 | inPath = os.ExpandEnv(inPath) | |
110 | 98 | |
111 | 99 | if filepath.IsAbs(inPath) { |
112 | 100 | return filepath.Clean(inPath) |