aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2020-08-03 13:38:46 -0700
committerRob Landley <rob@landley.net>2020-08-04 03:04:10 -0500
commit3ba988c453056cbdda2bc26f1b9cbc3b4697acd0 (patch)
tree9b54a59ab4ea475cae603d798c610166281270f2 /tests
parentab8f7729c0f7609a33e003ca145ca39f254ccbc4 (diff)
downloadtoybox-3ba988c453056cbdda2bc26f1b9cbc3b4697acd0.tar.gz
echo: fix trailing \0.
This is a follow-on from 310eefe, addressing the case where sscanf fails and returns -1.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/echo.test2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/echo.test b/tests/echo.test
index 012692ea..bd2c3ff7 100755
--- a/tests/echo.test
+++ b/tests/echo.test
@@ -49,3 +49,5 @@ testcmd "-eE" "-eE '\e'" '\\e\n' "" ""
# This is how bash's built-in echo behaves, but now how /bin/echo behaves.
toyonly testcmd "" "-e 'a\x123\ufb3bbc' | od -An -tx1" \
" 61 12 33 ef ac bb 62 63 0a\n" "" ""
+
+testcmd "trailing nul" "-ne 'a\0b\0' | od -An -tx1" " 61 00 62 00\n" "" ""