use a case statement rather than a bash substring, for portability

This commit is contained in:
rupa committed 2011-08-03 16:13:15 -04:00
1 parent 3638788227
commit a0f58616ec
1 file changed
+4 -2
+4 -2
View File
@@ -98,8 +98,10 @@ _z() {
[ "$fnd" ] || local list=1
# if we hit enter on a completion just go there
# completions will always start with /
[ -z "$list" -a -d "$last" -a "${last:0:1}" = "/" ] && cd "$last" && return
case "$last" in
# completions will always start with /
/*) [ -z "$list" -a -d "$last" ] && cd "$last" && return;;
esac
# no file yet
[ -f "$datafile" ] || return