SVN: rc-scripts/trunk/rc.d/init.d/functions

glen glen at pld-linux.org
Sun Sep 17 17:29:04 CEST 2006


Author: glen
Date: Sun Sep 17 17:29:04 2006
New Revision: 7768

Modified:
   rc-scripts/trunk/rc.d/init.d/functions
Log:
Always use cached  in show() function (There's no benefit of doing otherwise).

Modified: rc-scripts/trunk/rc.d/init.d/functions
==============================================================================
--- rc-scripts/trunk/rc.d/init.d/functions	(original)
+++ rc-scripts/trunk/rc.d/init.d/functions	Sun Sep 17 17:29:04 2006
@@ -125,8 +125,8 @@
 	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 @@
 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.


More information about the pld-cvs-commit mailing list