From bca437648018b3598cd0d27df28f922c3bdc71ae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 17 Sep 2006 18:14:08 +0000 Subject: [PATCH] Correct show() function printf handling. svn-id: @7781 --- rc.d/init.d/functions | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 62f2918b..3550fd38 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -41,7 +41,7 @@ CPOWEREDBY="$CYAN" # "Powered by" color CPLD="$GREEN" # "PLD Linux Distribution" color CI="$RED" # Capital I color (press I to enter interactive startup) CRESMAN="$GREEN" # "Resource Manager" color -CHARS="" # Characters displayed on the begining of show line +CHARS="" # Characters displayed on the beginning of show line CCHARS="$NORMAL" # Color of these characters (look at /etc/sysconfig/init-colors.gentoo example) # Source configuration if available - may override default values @@ -330,22 +330,23 @@ msg_usage() # Some functions to handle PLD Linux-style messages show() { - typeset text - text="$@" + typeset out - if is_no "$FASTRC" && is_yes "$GETTEXT"; then - text=$(nls "$text") - fi + echo -n "$INIT_DOTS" + termput hpa 0 + if [ -n "$CHARS" ]; then + termput setaf $CCHARS + echo -n "$CHARS" + termput op + fi - echo -n "$INIT_DOTS" - termput hpa 0 - if [ -n "$CHARS" ]; then - termput setaf $CCHARS - echo -n "$CHARS" - termput op - fi - printf "$@" - termput hpa $INIT_COL + if is_no "$FASTRC" && is_yes "$GETTEXT"; then + nls -n "$@" + else + printf "$@" + fi + + termput hpa $INIT_COL } # Displays message in square brackests ("[ DONE ]"). Takes two arguments. -- 2.44.0