From 6cfe10c6320b1a68e67b311a34e801f0a9d66c08 Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Mon, 4 Feb 2019 01:47:21 +0800 Subject: [PATCH] fixed pwd --- z.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/z.lua b/z.lua index ee8ce78..c369139 100755 --- a/z.lua +++ b/z.lua @@ -1235,6 +1235,9 @@ function z_match(patterns, method, subdir) end table.sort(M, function (a, b) return a.score > b.score end) local pwd = (PWD == nil or PWD == '') and os.getenv('PWD') or PWD + if pwd == nil or pwd == '' then + pwd = os.pwd() + end if pwd ~= '' and pwd ~= nil then if subdir then local N = {}