diff --git a/src/prefs/DirectoriesPrefs.cpp b/src/prefs/DirectoriesPrefs.cpp index 8043f0b3d..0d5064e67 100644 --- a/src/prefs/DirectoriesPrefs.cpp +++ b/src/prefs/DirectoriesPrefs.cpp @@ -418,6 +418,10 @@ bool DirectoriesPrefs::Validate() } else { /* If the directory already exists, make sure it is writable */ + if (!FileNames::WritableLocationCheck(mTempText->GetValue())) + { + return false; + } wxLogNull logNo; Temp.AppendDir(wxT("canicreate")); path = Temp.GetPath(); @@ -443,6 +447,19 @@ bool DirectoriesPrefs::Validate() wxOK | wxCENTRE | wxICON_INFORMATION); } + const wxString macroPathString = mMacrosText->GetValue(); + + if (!macroPathString.empty()) + { + const wxFileName macroPath { macroPathString }; + + if (macroPath.DirExists()) + { + if (!FileNames::WritableLocationCheck(macroPathString)) + return false; + } + } + return true; }