]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
Always use cached in show() function (There's no benefit of doing otherwise).
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 17 Sep 2006 15:29:04 +0000 (15:29 +0000)
committerElan Ruusamäe <glen@pld-linux.org>
Sun, 17 Sep 2006 15:29:04 +0000 (15:29 +0000)
svn-id: @7768

rc.d/init.d/functions

index c97bf5c0fa0a9cb5eccf38a9018ebb047bb3c7cd..74a5e306d2faf3ea1b0033c03a8e44f56bf006f2 100644 (file)
@@ -125,8 +125,8 @@ is_no()
        esac
 }
 
+INIT_DOTS=$(awk -vcol=$INIT_COL 'BEGIN{ for(i = 0; i < col; i++) printf("."); }')
 if is_yes "$FASTRC"; then
-       INIT_DOTS=$(awk "BEGIN{for(\$i=0;\$i<$INIT_COL;\$i++)printf(\".\");}")
        RC_LOGGING=no
 fi
 
@@ -318,27 +318,21 @@ msg_usage()
 show()
 {
        typeset text
+       text="$@"
 
-       if is_yes "$FASTRC"; then
-               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
-       else
-               text=$(nls "$@")
-               if [ -n "$CHARS" ]; then
-                       termput setaf $CCHARS
-                       echo -n "$CHARS"
-                       termput op
-               fi
-               echo -n "$text"
-               awk "BEGIN { for (j=length(\"$CHARS$text\"); j<$INIT_COL; j++) printf \".\" }"
+       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
+       printf "$@"
+       termput hpa $INIT_COL
 }
 
 # Displays message in square brackests ("[ DONE ]"). Takes two arguments.
This page took 0.055694 seconds and 4 git commands to generate.