[arch-projects] [devtools] [PATCH 1/2] common: Properly forward arguments from die to error

Dave Reisner dreisner at archlinux.org
Tue Jul 30 11:00:54 EDT 2013


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 <dreisner at archlinux.org>
---
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



More information about the arch-projects mailing list