Also allow this function to be called without arguments, in which case,
don't call error at all. Some uses of this function wrongly assumed
that this was already allowed.

Signed-off-by: Dave Reisner <[email protected]>
---
It's possible that we just want to fix the die callsites that abuse this.
Feedback welcome.

 lib/common.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/common.sh b/lib/common.sh
index 9446ff5..3ec26ff 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -82,7 +82,7 @@ trap_exit() {
 }
 
 die() {
-       error "$*"
+       (( $# )) && error "$@"
        cleanup 1
 }
 
-- 
1.8.3.4

Reply via email to