summaryrefslogtreecommitdiffstats
path: root/config.tests/unix/padstring
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2009-03-23 10:18:55 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2009-03-23 10:18:55 +0100
commite5fcad302d86d316390c6b0f62759a067313e8a9 (patch)
treec2afbf6f1066b6ce261f14341cf6d310e5595bc1 /config.tests/unix/padstring
Long live Qt 4.5!
Diffstat (limited to 'config.tests/unix/padstring')
-rwxr-xr-xconfig.tests/unix/padstring22
1 files changed, 22 insertions, 0 deletions
diff --git a/config.tests/unix/padstring b/config.tests/unix/padstring
new file mode 100755
index 0000000000..283475d071
--- /dev/null
+++ b/config.tests/unix/padstring
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+LEN="$1"
+STR="$2"
+PAD='\0'
+STRLEN=`echo $STR | wc -c`
+RES="$STR"
+
+EXTRALEN=`expr $LEN - $STRLEN`
+while [ "$EXTRALEN" -gt 32 ]; do
+ RES="$RES$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD"
+ EXTRALEN=`expr $EXTRALEN - 32`
+done
+while [ "$EXTRALEN" -gt 0 ]; do
+ RES="$RES$PAD"
+ EXTRALEN=`expr $EXTRALEN - 1`
+done
+cat <<EOF
+$RES
+EOF
+
+