summaryrefslogtreecommitdiff
path: root/t/test-lib-functions.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/test-lib-functions.sh')
-rw-r--r--t/test-lib-functions.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 216918a58c..88b7dbd69a 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -1373,11 +1373,10 @@ packetize() {
packet="$*"
printf '%04x%s' "$((4 + ${#packet}))" "$packet"
else
- cat >packetize.tmp &&
- len=$(wc -c <packetize.tmp) &&
- printf '%04x' "$(($len + 4))" &&
- cat packetize.tmp &&
- rm -f packetize.tmp
+ perl -e '
+ my $packet = do { local $/; <STDIN> };
+ printf "%04x%s", 4 + length($packet), $packet;
+ '
fi
}