Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
I shouldn't commit when I'm this sleepy
  • Loading branch information
JoshDreamland committed Aug 18, 2017
1 parent 18cb5b7 commit 34e3c17
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions CompilerSource/filesystem/file_find.cpp
Expand Up @@ -46,23 +46,25 @@ using namespace std;
string file_find_first(string name,int attributes)
{
if (current_find != INVALID_HANDLE_VALUE) file_find_close();

ff_attribs = attributes;
current_find = FindFirstFile(name.c_str(), &found);
if (current_find == INVALID_HANDLE_VALUE) return "";

return ff_matches() ? found.cFileName : file_find_next();
}

string file_find_next()
{
if (current_find == INVALID_HANDLE_VALUE) return "";

do {
if (!FindNextFile(current_find, &found)) {
file_find_close();
return "";
}
} while (!ff_matches());

return found.cFileName;
}

Expand Down

0 comments on commit 34e3c17

Please sign in to comment.