commit:     47a622418d5745d15d6b47ec2c63ab060e39dd25
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sat Feb 18 11:00:09 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 19 16:14:07 2023 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=47a62241

Precede end columns with a single space, not two, in _eend()

A beneficial effect of doing so, apart from being able to show one more
character, is that the the associated arithmetic expansions uniformly
work with the genuine length of the end column, which is 7.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 functions.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/functions.sh b/functions.sh
index beaef03..c287b24 100644
--- a/functions.sh
+++ b/functions.sh
@@ -253,10 +253,10 @@ _eend()
        fi
 
        if [ "${is_tty}" -eq 1 ] && [ -n "${genfun_endcol}" ]; then
-               printf '%s  %s\n' "${genfun_endcol}" "${msg}"
+               printf '%s %s\n' "${genfun_endcol}" "${msg}"
        else
                [ "${genfun_lastcall}" = ebegin ] || genfun_lastbegun_strlen=0
-               printf "%$(( cols - genfun_lastbegun_strlen - 6 ))s%s\n" '' 
"${msg}"
+               printf "%$(( cols - genfun_lastbegun_strlen - 7 ))s %s\n" '' 
"${msg}"
        fi
 
        return "${retval}"
@@ -536,8 +536,8 @@ done
 # Set an ECMA-48 CSI sequence, allowing for eend to line up the [ ok ] string.
 {
        genfun_endcol="$(tput cuu1)" \
-       && genfun_endcol="${genfun_endcol}$(tput cuf -- "$(( genfun_cols - 8 
))")" \
-       || genfun_endcol="$(printf '\033[A\033[%dC' "$(( genfun_cols - 8 ))")"
+       && genfun_endcol="${genfun_endcol}$(tput cuf -- "$(( genfun_cols - 7 
))")" \
+       || genfun_endcol="$(printf '\033[A\033[%dC' "$(( genfun_cols - 7 ))")"
 } 2>/dev/null
 
 # Setup the colors so our messages all look pretty

Reply via email to