diff options
author | David Remy <19895637+dpremy@users.noreply.github.com> | 2019-04-09 04:58:45 -0600 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2019-04-09 12:58:45 +0200 |
commit | 62abacebea3f93514e41720c689399bcdc74ff39 (patch) | |
tree | 80d8acf00bb72f6be1b093a5946852a9e31cd29e /lib/history.zsh | |
parent | 680755bbe61b3a6226638b0cb0f982019b1cb387 (diff) | |
download | zsh-62abacebea3f93514e41720c689399bcdc74ff39.tar.gz zsh-62abacebea3f93514e41720c689399bcdc74ff39.tar.bz2 zsh-62abacebea3f93514e41720c689399bcdc74ff39.zip |
lib: fix issues with nounset and parameters used before defined (#7433)
Diffstat (limited to 'lib/history.zsh')
-rw-r--r-- | lib/history.zsh | 4 |
1 files changed, 2 insertions, 2 deletions
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' ;; |