awk: fix printf "%-10c", 0

function                                             old     new   delta
awk_printf                                           596     626     +30

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2021-07-12 11:27:11 +02:00
parent caa93ecdd3
commit 8d269ef859
2 changed files with 13 additions and 4 deletions

View File

@@ -415,6 +415,14 @@ testing "awk printf('%c') can output NUL" \
"awk '{printf(\"hello%c null\n\", 0)}'" "hello\0 null\n" "" "\n"
SKIP=
optional FEATURE_AWK_GNU_EXTENSIONS
testing "awk printf('%-10c') can output NUL" \
"awk 'BEGIN { printf \"[%-10c]\n\", 0 }' | od -tx1" "\
0000000 5b 00 20 20 20 20 20 20 20 20 20 5d 0a
0000015
" "" ""
SKIP=
# testing "description" "command" "result" "infile" "stdin"
testing 'awk negative field access' \
'awk 2>&1 -- '\''{ $(-1) }'\' \