From 48f756085b499d96359f355eb21735371020332c Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Fri, 29 Jan 2021 10:46:02 +0100 Subject: [PATCH] fix(path) makepath would fail to create a top-level dir In case of "/blaa" the pattern would fail to match --- lua/pl/dir.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/pl/dir.lua b/lua/pl/dir.lua index 4e3922e1..b19c8fc4 100644 --- a/lua/pl/dir.lua +++ b/lua/pl/dir.lua @@ -366,8 +366,10 @@ do end if not path.isdir(p) then local subp = p:match(dirpat) - local ok, err = _makepath(subp) - if not ok then return nil, err end + if subp then + local ok, err = _makepath(subp) + if not ok then return nil, err end + end return mkdir(p) else return true