summaryrefslogtreecommitdiff
path: root/src/misc1.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-04-05 22:50:40 +0200
committerBram Moolenaar <Bram@vim.org>2019-04-05 22:50:40 +0200
commit543c9b1921d7605498b54afdef518e312f1b4515 (patch)
tree698a18418c2db2f58dd124b732ec0c193373e307 /src/misc1.c
parent577fadfc100ff8fa569a34b89f5ad055ad726646 (diff)
downloadvim-git-543c9b1921d7605498b54afdef518e312f1b4515.tar.gz
patch 8.1.1120: cannot easily get directory entry matchesv8.1.1120
Problem: Cannot easily get directory entry matches. Solution: Add the readdir() function. (Yasuhiro Matsumoto, closes #2439)
Diffstat (limited to 'src/misc1.c')
-rw-r--r--src/misc1.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/misc1.c b/src/misc1.c
index f6d6c1817..54da8900e 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -5790,6 +5790,9 @@ dos_expandpath(
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