diff options
author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2021-01-29 12:46:02 +0300 |
---|---|---|
committer | Thijs Schreijer <thijs@thijsschreijer.nl> | 2021-01-31 10:14:59 +0300 |
commit | 1fcca99dfcdcd3d9a6a161d9588d8233b836aedc (patch) | |
tree | bd5f29e455bbfd14b4b4802c513ae75eb2160bc5 /lua | |
parent | 480134cbb2d4141be31901028078d18a2701ea6b (diff) |
fix(path) makepath would fail to create a top-level dir
In case of "/blaa" the pattern would fail to match
Diffstat (limited to 'lua')
-rw-r--r-- | lua/pl/dir.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lua/pl/dir.lua b/lua/pl/dir.lua index 4e3922e..b19c8fc 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 |