More bug fixes

This commit is contained in:
斟酌 鵬兄 2014-12-24 18:42:12 +08:00
parent e751f68f20
commit 91a584dc46

View File

@ -92,6 +92,7 @@ __go_nav() {
IFS="/" read -a PWDA <<< "$(pwd)" IFS="/" read -a PWDA <<< "$(pwd)"
MARK=0 MARK=0
NOT_FOUND=1
LISTOF='' LISTOF=''
for i in "${!PWDA[@]}" for i in "${!PWDA[@]}"
do do
@ -103,6 +104,7 @@ __go_nav() {
MARK=$i MARK=$i
if [ -n "$ARG3" ] && [[ "$STACK" =~ "$ARG3" ]]; then if [ -n "$ARG3" ] && [[ "$STACK" =~ "$ARG3" ]]; then
unset NOT_FOUND
break break
fi fi
@ -112,10 +114,11 @@ __go_nav() {
done done
if [ -z "$ARG3" ]; then if [ -z "$ARG3" ]; then
unset NOT_FOUND
MARK=$(( $MARK - 1 )) MARK=$(( $MARK - 1 ))
fi fi
if [[ $MARK -eq 0 ]]; then if [ -n "$NOT_FOUND" ]; then
echo "No such token in up stack: $ARG3" echo "No such token in up stack: $ARG3"
echo -e $LISTOF; echo -e $LISTOF;
echo echo