Skip to content

Commit

Permalink
handle file errors when loading xcursor themes
Browse files Browse the repository at this point in the history
  • Loading branch information
ikalco committed Aug 14, 2024
1 parent 3b4aabe commit c07e01c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/managers/XCursorManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,11 @@ std::vector<SP<SXCursors>> CXCursorManager::loadAllFromDir(std::string const& pa

if (std::filesystem::exists(path) && std::filesystem::is_directory(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;
}

auto const& full = entry.path().string();
using PcloseType = int (*)(FILE*);
Expand Down

0 comments on commit c07e01c

Please sign in to comment.