diff options
| -rw-r--r-- | lexers/LexLPeg.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lexers/LexLPeg.cxx b/lexers/LexLPeg.cxx index 2d54e2547..d302b85e2 100644 --- a/lexers/LexLPeg.cxx +++ b/lexers/LexLPeg.cxx @@ -255,13 +255,15 @@ class LexerLPeg : public ILexer { } closedir(dir); #else - struct __finddata_t file; - intptr_t handle = _findfirst(path + "/*", &file); // TODO: - while (handle != -1) { + struct _finddata_t file; + std::string glob(path); + glob += "/*"; + intptr_t handle = _findfirst(glob.c_str(), &file); + if (handle == -1) return; + do { char *p = strstr(file.name, ".lua"); if (p) lexer_names.emplace(file.name, p - file.name); - handle = _findnext(handle, &file) - } + } while (_findnext(handle, &file) != -1); _findclose(handle); #endif } |
