From 6182a56fb6dfc5e1b7f0364124642e7fb3aaf7d0 Mon Sep 17 00:00:00 2001 From: Jaromil Date: Mon, 11 Dec 2017 08:05:40 +0100 Subject: [PATCH] fix bug in message rendering: stop overriding $i if existing this small bug caused rewriting the $i variable (often used as iterator in loops) whenever a log message was produced. Fix also includes an acceleration of log printing by substituting seq with native zsh notation. --- tomb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tomb b/tomb index eb3f9e9..1e6f29c 100755 --- a/tomb +++ b/tomb @@ -701,9 +701,9 @@ option_value() { # Messaging function with pretty coloring function _msg() { local msg="$2" + local i command -v gettext 1>/dev/null 2>/dev/null && msg="$(gettext -s "$2")" - for i in $(seq 3 ${#}); - do + for i in {3..${#}}; do msg=${(S)msg//::$(($i - 2))*::/$*[$i]} done