patch 8.1.1120: cannot easily get directory entry matches
Problem: Cannot easily get directory entry matches.
Solution: Add the readdir() function. (Yasuhiro Matsumoto, closes #2439)
diff --git a/src/misc1.c b/src/misc1.c
index f6d6c18..54da890 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -5790,6 +5790,9 @@
while (ok)
{
p = utf16_to_enc(wfb.cFileName, NULL); // p is allocated here
+ if (p == NULL)
+ break; // out of memory
+
// Ignore entries starting with a dot, unless when asked for. Accept
// all entries found with "matchname".
if ((p[0] != '.' || starts_with_dot