summaryrefslogtreecommitdiffstats
path: root/Test/D07multibyte.ztst
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2022-12-17 00:09:37 +0100
committerOliver Kiddle <opk@zsh.org>2022-12-17 00:37:19 +0100
commit35a2f155c3b92e67957325e1f49e409546378e3e (patch)
tree7c4593cf459ae5067627043c7fba15866c48c8c6 /Test/D07multibyte.ztst
parent51207: fix for read -d when the delimiter is a byte >= 0x80 (diff)
downloadzsh-35a2f155c3b92e67957325e1f49e409546378e3e.tar
zsh-35a2f155c3b92e67957325e1f49e409546378e3e.tar.gz
zsh-35a2f155c3b92e67957325e1f49e409546378e3e.tar.bz2
zsh-35a2f155c3b92e67957325e1f49e409546378e3e.tar.lz
zsh-35a2f155c3b92e67957325e1f49e409546378e3e.tar.xz
zsh-35a2f155c3b92e67957325e1f49e409546378e3e.tar.zst
zsh-35a2f155c3b92e67957325e1f49e409546378e3e.zip
51214: handle read -d and a delimiter that can't be decoded into a character
Terminate input at the raw byte value of the delimiter. Also document and test the use of an empty string as a way to specify NUL as the delimiter.
Diffstat (limited to 'Test/D07multibyte.ztst')
-rw-r--r--Test/D07multibyte.ztst14
1 files changed, 14 insertions, 0 deletions
diff --git a/Test/D07multibyte.ztst b/Test/D07multibyte.ztst
index 6909346cb..413c4fe73 100644
--- a/Test/D07multibyte.ztst
+++ b/Test/D07multibyte.ztst
@@ -212,6 +212,20 @@
>first
>second
+ read -ed £
+0:read with multibyte delimiter where bytes of delimiter also occur in input
+<one¤twoãthree£four
+>one¤twoãthree
+
+ read -ed $'\xa0' <<<$'first\xa0second'
+0:read delimited by a byte that isn't a valid multibyte character
+>first
+
+ read -ed $'\xc2'
+0:read delimited by a single byte terminates if the byte is part of a multibyte character
+<one£two
+>one
+
(IFS=«
read -d » -A array
print -l $array)