RawTherapee crashes in c:\users\{username}, Issue 2727
This commit is contained in:
@@ -464,6 +464,18 @@ Glib::ustring safe_get_user_home_dir() {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
Glib::ustring safe_get_user_profile_dir() {
|
||||||
|
WCHAR pathW[MAX_PATH]={0};
|
||||||
|
if (SHGetSpecialFolderPathW(NULL,pathW,CSIDL_PROFILE,false)) {
|
||||||
|
char pathA[MAX_PATH];
|
||||||
|
WideCharToMultiByte(CP_UTF8,0,pathW,-1,pathA,MAX_PATH,0,0);
|
||||||
|
return Glib::ustring(pathA);
|
||||||
|
} else return Glib::ustring("C:\\");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
Glib::ustring safe_get_user_desktop_dir() {
|
Glib::ustring safe_get_user_desktop_dir() {
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@@ -489,7 +501,7 @@ Glib::ustring safe_get_user_desktop_dir() {
|
|||||||
*
|
*
|
||||||
* Warning: this function is a workaround for Windows platform, and not necessarily bullet proof
|
* Warning: this function is a workaround for Windows platform, and not necessarily bullet proof
|
||||||
*/
|
*/
|
||||||
bool safe_is_shortcut_dir (const Glib::ustring& path) {
|
bool safe_is_shortcut_dir (const Glib::ustring& path) {
|
||||||
return PathIsRootA(path.c_str()) || safe_get_user_home_dir() == path || safe_get_user_desktop_dir() == path; // || safe_get_user_picture_dir() == path;
|
return PathIsRootA(path.c_str()) || safe_get_user_home_dir() == path || safe_get_user_desktop_dir() == path || safe_get_user_profile_dir() == path; // || safe_get_user_picture_dir() == path;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -44,7 +44,8 @@ Glib::ustring safe_get_user_picture_dir();
|
|||||||
Glib::ustring safe_get_user_home_dir();
|
Glib::ustring safe_get_user_home_dir();
|
||||||
Glib::ustring safe_get_user_desktop_dir();
|
Glib::ustring safe_get_user_desktop_dir();
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
Glib::ustring safe_get_user_profile_dir();
|
||||||
bool safe_is_shortcut_dir (const Glib::ustring& filename);
|
bool safe_is_shortcut_dir (const Glib::ustring& filename);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user