From 8c1a6d7b50cd9e59d915c488ec25cd6db6d02a21 Mon Sep 17 00:00:00 2001 From: midipix Date: Mar 23 2021 09:55:11 +0000 Subject: build system: ccenv_{tool|attr}_epilog(): properly handle long output strings. --- diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh index fd09506..4b91387 100644 --- a/sofort/ccenv/ccenv.sh +++ b/sofort/ccenv/ccenv.sh @@ -68,6 +68,11 @@ ccenv_tool_epilog() ccenv_line_dots='................................' ccenv_tool_dlen="$((${#ccenv_line_dots} - ${#1}))" + case ${ccenv_tool_dlen} in + 0 | -* ) + ccenv_tool_dlen='3' ;; + esac + printf "%${ccenv_tool_dlen}.${ccenv_tool_dlen}s %s.\n" \ "${ccenv_line_dots}" "${1}" @@ -110,6 +115,11 @@ ccenv_attr_epilog() ccenv_line_dots='................................' ccenv_tool_dlen="$((${#ccenv_line_dots} - 1 - ${#1}))" + case ${ccenv_tool_dlen} in + 0 | -* ) + ccenv_tool_dlen='3' ;; + esac + printf "%${ccenv_tool_dlen}.${ccenv_tool_dlen}s %s.\n" \ "${ccenv_line_dots}" "${1}"