diff --git a/README.md b/README.md index fe91e8a..7408b21 100644 --- a/README.md +++ b/README.md @@ -400,6 +400,7 @@ awk -F '\t' '{print $2 "|" $1 "|" 0}' $FN >> ~/.zlua ## History +- 1.4.3 (2019-02-08): fixed minor issues. - 1.4.2 (2019-02-06): you can disabled path validation by `$_ZL_NO_CHECK`, and use `z --purge` to clear bad paths manually. - 1.4.1 (2019-02-06): fzf tab-completion in bash (@[BarbUk](https://github.com/BarbUk)), fixed hang in fish shell (close [#29](https://github.com/skywind3000/z.lua/issues/29)). - 1.4.0 (2019-02-04): Ported to Power Shell ([@manhong2112](https://github.com/manhong2112)) diff --git a/z.lua b/z.lua index c8558d5..d8a5b61 100755 --- a/z.lua +++ b/z.lua @@ -4,7 +4,7 @@ -- z.lua - a cd command that learns, by skywind 2018, 2019 -- Licensed under MIT license. -- --- Version 1.4.2, Last Modified: 2019/02/06 20:23 +-- Version 1.4.3, Last Modified: 2019/02/08 11:35 -- -- * 10x faster than fasd and autojump, 3x faster than z.sh -- * available for posix shells: bash, zsh, sh, ash, dash, busybox @@ -422,6 +422,15 @@ end -- dir exists ----------------------------------------------------------------------- function os.path.isdir(pathname) + if pathname == '/' then + return true + elseif windows then + if pathname == '\\' then + return true + elseif pathname:match('^%a:[/\\]$') then + return true + end + end local name = pathname .. '/' local ok, err, code = os.rename(name, name) if not ok then