From 961c09dc3b7b6873bcba22c0a1bb71eb389a4f2b Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Fri, 8 Feb 2019 16:08:47 +0800 Subject: [PATCH] commit z.lua --- z.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/z.lua b/z.lua index d8a5b61..68e29a8 100755 --- a/z.lua +++ b/z.lua @@ -1367,7 +1367,12 @@ function z_cd(patterns) return os.path.expand('~') end if os.path.isabs(last) and os.path.isdir(last) then - return os.path.norm(last) + local size = #patterns + if size <= 1 then + return os.path.norm(last) + elseif last ~= '/' and last ~= '\\' then + return os.path.norm(last) + end end local M = z_match(patterns, Z_METHOD, Z_SUBDIR) if M == nil then