aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormitchell <unknown>2020-03-10 15:04:57 -0400
committermitchell <unknown>2020-03-10 15:04:57 -0400
commitb457f2284ad7a1ae77f283fffcb7625637756c5e (patch)
tree70badc97d64c0712916f7d5ce0e5cd6acf994531
parente02a7b49e160cbc00d763a979d99deb3b48a8488 (diff)
downloadscintilla-mirror-b457f2284ad7a1ae77f283fffcb7625637756c5e.tar.gz
Fixed LexLPeg reporting of known lexers on Win32.
-rw-r--r--lexers/LexLPeg.cxx12
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
}