From 9f0292c1f9be9aabc7bb468e6fe6c26f8c2ee1c6 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 21 Mar 2021 08:43:18 +0000 Subject: build system: ccenv_{tool|attr}_epilog(): properly handle long output strings. --- sofort/ccenv/ccenv.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) 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}" -- cgit v1.2.3