From 62abacebea3f93514e41720c689399bcdc74ff39 Mon Sep 17 00:00:00 2001
From: David Remy <19895637+dpremy@users.noreply.github.com>
Date: Tue, 9 Apr 2019 04:58:45 -0600
Subject: lib: fix issues with nounset and parameters used before defined
 (#7433)

---
 lib/history.zsh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'lib/history.zsh')

diff --git a/lib/history.zsh b/lib/history.zsh
index d8bbd41c4..52e45bf4c 100644
--- a/lib/history.zsh
+++ b/lib/history.zsh
@@ -12,12 +12,12 @@ function omz_history {
     builtin fc "$@"
   else
     # unless a number is provided, show all history events (starting from 1)
-    [[ ${@[-1]} = *[0-9]* ]] && builtin fc -l "$@" || builtin fc -l "$@" 1
+    [[ ${@[-1]-} = *[0-9]* ]] && builtin fc -l "$@" || builtin fc -l "$@" 1
   fi
 }
 
 # Timestamp format
-case $HIST_STAMPS in
+case ${HIST_STAMPS-} in
   "mm/dd/yyyy") alias history='omz_history -f' ;;
   "dd.mm.yyyy") alias history='omz_history -E' ;;
   "yyyy-mm-dd") alias history='omz_history -i' ;;
-- 
cgit v1.2.3-70-g09d2