From b457f2284ad7a1ae77f283fffcb7625637756c5e Mon Sep 17 00:00:00 2001 From: mitchell Date: Tue, 10 Mar 2020 15:04:57 -0400 Subject: Fixed LexLPeg reporting of known lexers on Win32. --- lexers/LexLPeg.cxx | 12 +++++++----- 1 file 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 } -- cgit v1.2.3