Skip to content

Commit

Permalink
Merge pull request #3462 from DomCristaldi/walk-symlink-chain
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexays authored Jul 21, 2024
2 parents cb8fc1c + 58e21e8 commit cece04e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/util/css_reload_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,14 @@ std::string waybar::CssReloadHelper::findPath(const std::string& filename) {
}

// File monitor does not work with symlinks, so resolve them
if (std::filesystem::is_symlink(result)) {
std::string original = result;
while(std::filesystem::is_symlink(result)) {
result = std::filesystem::read_symlink(result);

// prevent infinite cycle
if (result == original) {
break;
}
}

return result;
Expand Down

0 comments on commit cece04e

Please sign in to comment.