Merge pull request #3462 from DomCristaldi/walk-symlink-chain

This commit is contained in:
Alexis Rouillard 2024-07-21 09:47:43 +02:00 committed by GitHub
commit cece04e02f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -43,8 +43,14 @@ std::string waybar::CssReloadHelper::findPath(const std::string& filename) {
} }
// File monitor does not work with symlinks, so resolve them // 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); result = std::filesystem::read_symlink(result);
// prevent infinite cycle
if (result == original) {
break;
}
} }
return result; return result;