Skip to content

Commit 465f2b8

Browse files
author
skywind3000
committed
fixed linux $_ZL_DATA failure
1 parent ff9d874 commit 465f2b8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

z.lua

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-- z.lua - a cd command that learns, by skywind 2018, 2019
55
-- Licensed under MIT license.
66
--
7-
-- Version 1.7.0, Last Modified: 2019/03/09 16:51
7+
-- Version 1.7.1, Last Modified: 2019/06/07 22:07
88
--
99
-- * 10x faster than fasd and autojump, 3x faster than z.sh
1010
-- * available for posix shells: bash, zsh, sh, ash, dash, busybox
@@ -1869,11 +1869,8 @@ function z_init()
18691869
DATA_FILE = _zl_data
18701870
else
18711871
-- avoid windows environments affect cygwin & msys
1872-
if _zl_data:sub(2, 2) ~= ':' then
1873-
local t = _zl_data:sub(3, 3)
1874-
if t ~= '/' and t ~= "\\" then
1875-
DATA_FILE = _zl_data
1876-
end
1872+
if not string.match(_zl_data, '^%a:[/\\]') then
1873+
DATA_FILE = _zl_data
18771874
end
18781875
end
18791876
end

0 commit comments

Comments
 (0)