From 0b9526e3b4a4ff554d2d20a9a72d945bf7565068 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 14 Oct 2015 22:06:47 -0700 Subject: [PATCH] Don't check `$1` unless `$#` is >= 1. Fixes #873. Partially fixes #868. --- nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index 7084e4c..2dae812 100755 --- a/nvm.sh +++ b/nvm.sh @@ -2239,7 +2239,7 @@ $NVM_LS_REMOTE_POST_MERGED_OUTPUT" | command grep -v "N/A" | command sed '/^$/d' } nvm_supports_source_options() { - [ "_$(echo 'echo $1' | . /dev/stdin yes 2> /dev/null)" = "_yes" ] + [ "_$(echo '[ $# -gt 0 ] && echo $1' | . /dev/stdin yes 2> /dev/null)" = "_yes" ] } nvm_supports_xz() {