penguin/utils

my env utils

commit 91a584dc46c34b3c285487cfafca451724eccaaa

author斟酌 鵬兄 <tgckpg@gmail.com>
date2014-12-24T10:42:12Z
subjectMore bug fixes
commit 91a584dc46c34b3c285487cfafca451724eccaaa
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date:   2014-12-24T10:42:12Z

    More bug fixes
---
 bash/bashrc/sources/40_go-command | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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