Skip to content

Commit d9c7e00

Browse files
committed
Make replacement slightly safer
1 parent 38a341a commit d9c7e00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/config/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func (c *Config) loadSettings() error {
211211

212212
func normalizePath(homeDir string, path string) string {
213213
if strings.HasPrefix(path, "~") {
214-
path = strings.Replace(path, "~", homeDir, 1)
214+
path = filepath.Join(homeDir, path[1:])
215215
}
216216
return filepath.Clean(path)
217217
}

0 commit comments

Comments
 (0)