git repos / blockattack-game

commit 84003a0e

Poul Sander · 2021-10-20 21:47
84003a0eda7a707aa345892d8564c0da74f782ed patch · browse files
parent 493079d13c42b625785fefe46955291144d7f7e7

Lessned scope of a variable

Changed files

M source/code/os.cpp before
diff --git a/source/code/os.cpp b/source/code/os.cpp index d821fb6..47fdc6b 100644 --- a/source/code/os.cpp +++ b/source/code/os.cpp
@@ -139,8 +139,8 @@ std::vector<std::string> OsGetDirFileList(const std::string& path) {
//At the moment dirent.h is used for all OS. Should have a Unicode version on Windows.
std::vector<std::string> ret;
DIR* dir = opendir(path.c_str());
- struct dirent* ent;
if (dir) {
+ struct dirent* ent;
while ((ent = readdir (dir)) ) {
if (ent->d_name[0] == '.') {
continue;