aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdiary6
1 files changed, 4 insertions, 2 deletions
diff --git a/diary b/diary
index 724bca5..0eb9455 100755
--- a/diary
+++ b/diary
@@ -140,7 +140,7 @@ else
fi
-pushd $diary_location > /dev/null
+[ -n "$diary_location" ] && pushd $diary_location > /dev/null
# set defaults
if [ ! "$EDITOR" ]
@@ -159,5 +159,7 @@ help) shift; cmd_help "$@" ;;
*) cmd_edit_or_usage "$@" ;;
esac
-popd > /dev/null
+[ -n "$diary_location" ] && popd > /dev/null
+
+exit 0