mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-25 16:49:48 +01:00
parent
54376d7b5f
commit
6fb8f50205
1 changed files with 6 additions and 1 deletions
|
@ -333,7 +333,12 @@ eHeadersErrors CPluginManager::headersValid() {
|
|||
std::string verHeaderContent((std::istreambuf_iterator<char>(ifs)), (std::istreambuf_iterator<char>()));
|
||||
ifs.close();
|
||||
|
||||
std::string hash = verHeaderContent.substr(verHeaderContent.find("#define GIT_COMMIT_HASH") + 23);
|
||||
const auto HASHPOS = verHeaderContent.find("#define GIT_COMMIT_HASH");
|
||||
|
||||
if (HASHPOS == std::string::npos || HASHPOS + 23 >= verHeaderContent.length())
|
||||
return HEADERS_CORRUPTED;
|
||||
|
||||
std::string hash = verHeaderContent.substr(HASHPOS + 23);
|
||||
hash = hash.substr(0, hash.find_first_of('\n'));
|
||||
hash = hash.substr(hash.find_first_of('"') + 1);
|
||||
hash = hash.substr(0, hash.find_first_of('"'));
|
||||
|
|
Loading…
Reference in a new issue