]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- shell magic fixing screwed dots in show() on serial console
authorJan Rękorajski <baggins@pld-linux.org>
Thu, 26 Apr 2007 21:38:04 +0000 (21:38 +0000)
committerJan Rękorajski <baggins@pld-linux.org>
Thu, 26 Apr 2007 21:38:04 +0000 (21:38 +0000)
svn-id: @8478

rc.d/init.d/functions

index 1d7a925a8b91fbacda3691cb34f7765d1b3eb3d7..d50ac577f32a0ddcabb5cc01ec67a2e8a793bc9b 100644 (file)
@@ -100,7 +100,6 @@ is_no()
        esac
 }
 
-INIT_DOTS=$(awk -vcol=$INIT_COL 'BEGIN{ for(i = 0; i < col; i++) printf("."); }')
 if is_yes "$FASTRC"; then
        RC_LOGGING=no
 fi
@@ -292,26 +291,26 @@ msg_usage()
 # Some functions to handle PLD Linux-style messages
 show()
 {
-       typeset out
+       typeset text
+       typeset -i len
 
-       out=$(
-               echo -n "$INIT_DOTS"
-               termput hpa 0
-               if [ -n "$CHARS" ]; then
-                       termput setaf $CCHARS
-                       echo -n "$CHARS"
-                       termput op
-               fi
-
-               if is_no "$FASTRC" && is_yes "$GETTEXT"; then
-                       nls -n "$@"
-               else
-                       printf "$@"
-               fi
+       if is_no "$FASTRC" && is_yes "$GETTEXT"; then
+               text=$(nls -n "$@")
+       else
+               text=$(printf "$@")
+       fi
+       len=${#text}
+       while [ $((len++)) -lt $INIT_COL ]; do
+               text="$text."
+       done
+       if [ -n "$CHARS" ]; then
+               termput setaf $CCHARS
+               echo -n "$CHARS"
+               termput op
+       fi
+       echo -n "$text"
 
-               termput hpa $INIT_COL
-       )
-       echo -n "$out"
+       termput hpa $INIT_COL
 }
 
 deltext()
This page took 0.267714 seconds and 4 git commands to generate.