Fix Directory Being Opened As File (#8)

Fixed a bug where the directory would be opened as a file. Add a check to avoid this.
This commit is contained in:
William Adam-Grenier 2025-03-03 21:42:34 -05:00 committed by GitHub
parent f2ae8ef9db
commit 6fd80818d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -74,6 +74,11 @@ int main(int argc, char** argv)
for (auto& file : std::filesystem::directory_iterator(input))
{
if (std::filesystem::is_directory(file))
{
continue;
}
size_t fileSize = 0;
auto fileData = readAllBytes(file.path().string().c_str(), fileSize);
bool foundAny = false;