You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a STRING with 256 given characters and [y*], this "repeated character" should expand to the empty string "". With only 255 given characters, it should expand to "y", i.e. a single character.
$ x226="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
$ echo -n 'hello'| ../gnu/src/tr -c '[:upper:]'${x226}'[y*]xxx'# "[y*]" expands to "y", and now set2 contains two distinct characters.../gnu/src/tr: when translating with complemented character classes,string2 must map all characters in the domain to one[$? = 1]
$ echo -n 'hello'| ../gnu/src/tr -c '[:upper:]'${x226}'[y*]xxxx'# "[y*]" expands to "", so set2 contains only one distinct character.xxxxx
$ echo -n 'hello'| cargo run tr -c '[:upper:]'${x226}'[y*]xxxx'# We handle the "" case correctly, accidentally.xxxxx
$ echo -n 'hello'| cargo run tr -c '[:upper:]'${x226}'[y*]xxx'# \342\200\246 but we fail in the "y" case.xxxxx
There are some other ways to detect it, but this is probably the easiest way.
In a
STRING
with 256 given characters and[y*]
, this "repeated character" should expand to the empty string""
. With only 255 given characters, it should expand to"y"
, i.e. a single character.There are some other ways to detect it, but this is probably the easiest way.
(Original issue: #6133)
The text was updated successfully, but these errors were encountered: