From ba6b42942b5780d02ade53e3fa6f4e3845b20c89 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 30 Sep 2018 12:35:41 +0000 Subject: fix the rest of the bug mitigated in the previous commit: do not embark on an infinite loop when -m is given and the file contains a NUL character; OK millert@ --- regress/usr.bin/wc/wc.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'regress') diff --git a/regress/usr.bin/wc/wc.sh b/regress/usr.bin/wc/wc.sh index 87b7b8638be..1e52c33d73a 100644 --- a/regress/usr.bin/wc/wc.sh +++ b/regress/usr.bin/wc/wc.sh @@ -56,6 +56,9 @@ test_wc() # single byte characters test_wc "two lines\nand five words\n" " 2 5 25" +# non-printable characters +test_wc "a\033b\000c\n" " 1 1 6" + # multibyte characters test_wc "ax\0314\0200b\n" " 1 1 5" " 1 1 6" test_wc "a\0354\0277\0277b\n" " 1 1 4" \ -- cgit v1.2.3