Dont use non-writeable locations containing kitty.conf as the config dir

This commit is contained in:
Kovid Goyal
2023-05-26 08:40:47 +05:30
parent 750018e5fe
commit d89c1426d5

View File

@@ -102,8 +102,10 @@ func ConfigDirForName(name string) (config_dir string) {
if loc != "" {
q := filepath.Join(loc, "kitty")
if _, err := os.Stat(filepath.Join(q, name)); err == nil {
config_dir = q
return
if unix.Access(q, unix.W_OK) == nil {
config_dir = q
return
}
}
}
}