diff options
| author | Mikael Magnusson <mikachu@gmail.com> | 2026-06-06 16:40:12 +0200 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@gmail.com> | 2026-06-10 05:20:51 +0200 |
| commit | 2136ff7f5045c963e5a41e920350b9a884752492 (patch) | |
| tree | a831c222d3f3dadb3aeebca4bef18948ec621482 /Test/D07multibyte.ztst | |
| parent | 54687: fix brace completion (diff) | |
| download | zsh-2136ff7f5045c963e5a41e920350b9a884752492.tar zsh-2136ff7f5045c963e5a41e920350b9a884752492.tar.gz zsh-2136ff7f5045c963e5a41e920350b9a884752492.tar.bz2 zsh-2136ff7f5045c963e5a41e920350b9a884752492.tar.lz zsh-2136ff7f5045c963e5a41e920350b9a884752492.tar.xz zsh-2136ff7f5045c963e5a41e920350b9a884752492.tar.zst zsh-2136ff7f5045c963e5a41e920350b9a884752492.zip | |
54688: handle Stéphane correctly
In the original report we had [[ é = *$'\xa9' ]] which has op == P_STAR,
in this case charstart is filled out inline, in the other cases it's
done by the patrepeat function. If ptlen > P_LS_LEN(next) we have
returned, if it is < then we have backtracked into the region where
charstart is valid and we can check that, and finally if they are equal
we know we are on a valid character boundary (but charstart might not be
valid here, in fact multiple tests fail if you leave out the ptlen
check).
Separately,
% [[ éé = é#$'\xa9' ]]; echo $?
pattern.c:4113: closure following more than one character
0
% [[ éé = (é)#$'\xa9' ]]; echo $?
1
so just treat multibyte single characters as "not simple", which fixes
that case too.
Diffstat (limited to 'Test/D07multibyte.ztst')
| -rw-r--r-- | Test/D07multibyte.ztst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Test/D07multibyte.ztst b/Test/D07multibyte.ztst index b65912fe9..28cb9d907 100644 --- a/Test/D07multibyte.ztst +++ b/Test/D07multibyte.ztst @@ -556,6 +556,23 @@ F:This is considered a bugfix in zsh [[ $'\xe3\x83\x9b' = ? ]] || print fail 4 0:Testing incomplete and invalid multibyte character components + [[ é != *$'\xc3'* ]] || print fail 1 + [[ é != *$'\xa9'* ]] || print fail 2 + [[ Stéphane != *$'\xc3'* ]] || print fail 3 + [[ Stéphane != *$'\xa9'* ]] || print fail 4 + [[ é != $'\xc3'* ]] || print fail 5 + [[ é != *$'\xa9' ]] || print fail 6 +0:Raw bytes don't match multibyte characters in * patterns + + [[ éé != é#$'\xa9' ]] || print fail 1 + [[ é != [aé]#$'\xa9' ]] || print fail 2 + [[ é != [^x]#$'\xa9' ]] || print fail 3 + [[ aé != [aé]#$'\xa9' ]] || print fail 4 + [[ aé != [^x]#$'\xa9' ]] || print fail 5 + [[ aé != [aé]##$'\xa9' ]] || print fail 6 + [[ aé != [^x]##$'\xa9' ]] || print fail 7 +0:Raw bytes don't match multibyte characters part 2 + print -r -- ${(q+):-ホ} foo='She said "ホ". I said "You can'\''t '\''ホ'\'' me!' print -r -- ${(q+)foo} |
