mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 16:25:59 +01:00
xcursor: handle file errors when loading xcursor themes (#7326)
This commit is contained in:
parent
197f880790
commit
d85ae306c5
1 changed files with 4 additions and 1 deletions
|
@ -511,8 +511,11 @@ std::vector<SP<SXCursors>> CXCursorManager::loadAllFromDir(std::string const& pa
|
||||||
|
|
||||||
if (std::filesystem::exists(path) && std::filesystem::is_directory(path)) {
|
if (std::filesystem::exists(path) && std::filesystem::is_directory(path)) {
|
||||||
for (const auto& entry : std::filesystem::directory_iterator(path)) {
|
for (const auto& entry : std::filesystem::directory_iterator(path)) {
|
||||||
if (!entry.is_regular_file() && !entry.is_symlink())
|
std::error_code e1, e2;
|
||||||
|
if ((!entry.is_regular_file(e1) && !entry.is_symlink(e2)) || e1 || e2) {
|
||||||
|
Debug::log(WARN, "XCursor failed to load shape {}: {}", entry.path().stem().string(), e1 ? e1.message() : e2.message());
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
auto const& full = entry.path().string();
|
auto const& full = entry.path().string();
|
||||||
using PcloseType = int (*)(FILE*);
|
using PcloseType = int (*)(FILE*);
|
||||||
|
|
Loading…
Reference in a new issue