mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 16:45:59 +01:00
crashreporter: avoid using empty CACHE_HOME
This commit is contained in:
parent
3d1a167960
commit
24c04a8b7c
1 changed files with 2 additions and 4 deletions
|
@ -130,7 +130,7 @@ void CrashReporter::createAndSaveCrash(int sig) {
|
||||||
|
|
||||||
std::ofstream ofs;
|
std::ofstream ofs;
|
||||||
std::string path;
|
std::string path;
|
||||||
if (!CACHE_HOME) {
|
if (!CACHE_HOME || std::string(CACHE_HOME).empty()) {
|
||||||
if (!std::filesystem::exists(std::string(HOME) + "/.hyprland")) {
|
if (!std::filesystem::exists(std::string(HOME) + "/.hyprland")) {
|
||||||
std::filesystem::create_directory(std::string(HOME) + "/.hyprland");
|
std::filesystem::create_directory(std::string(HOME) + "/.hyprland");
|
||||||
std::filesystem::permissions(std::string(HOME) + "/.hyprland", std::filesystem::perms::all, std::filesystem::perm_options::replace);
|
std::filesystem::permissions(std::string(HOME) + "/.hyprland", std::filesystem::perms::all, std::filesystem::perm_options::replace);
|
||||||
|
@ -139,7 +139,7 @@ void CrashReporter::createAndSaveCrash(int sig) {
|
||||||
path = std::string(HOME) + "/.hyprland/hyprlandCrashReport" + std::to_string(PID) + ".txt";
|
path = std::string(HOME) + "/.hyprland/hyprlandCrashReport" + std::to_string(PID) + ".txt";
|
||||||
ofs.open(path, std::ios::trunc);
|
ofs.open(path, std::ios::trunc);
|
||||||
|
|
||||||
} else if (CACHE_HOME) {
|
} else {
|
||||||
if (!std::filesystem::exists(std::string(CACHE_HOME) + "/hyprland")) {
|
if (!std::filesystem::exists(std::string(CACHE_HOME) + "/hyprland")) {
|
||||||
std::filesystem::create_directory(std::string(CACHE_HOME) + "/hyprland");
|
std::filesystem::create_directory(std::string(CACHE_HOME) + "/hyprland");
|
||||||
std::filesystem::permissions(std::string(CACHE_HOME) + "/hyprland", std::filesystem::perms::all, std::filesystem::perm_options::replace);
|
std::filesystem::permissions(std::string(CACHE_HOME) + "/hyprland", std::filesystem::perms::all, std::filesystem::perm_options::replace);
|
||||||
|
@ -147,8 +147,6 @@ void CrashReporter::createAndSaveCrash(int sig) {
|
||||||
|
|
||||||
path = std::string(CACHE_HOME) + "/hyprland/hyprlandCrashReport" + std::to_string(PID) + ".txt";
|
path = std::string(CACHE_HOME) + "/hyprland/hyprlandCrashReport" + std::to_string(PID) + ".txt";
|
||||||
ofs.open(path, std::ios::trunc);
|
ofs.open(path, std::ios::trunc);
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ofs << finalCrashReport;
|
ofs << finalCrashReport;
|
||||||
|
|
Loading…
Reference in a new issue