Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: String#strip, #strip!, #lstrip, and lstrip! strip leading NUL bytes. #2878

Merged
merged 1 commit into from
May 15, 2024

Conversation

sisshiki1969
Copy link
Contributor

This PR fixes #2877 .

Copy link
Member

@znz znz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます。
3.0.2 から変わっているのを確認できました。

% time docker run --platform linux/amd64 --rm -it ghcr.io/ruby/all-ruby env LANG=C.UTF-8 ALL_RUBY_SINCE=ruby-1.8 ./all-ruby -e 'p " \0 abc \0".strip'
ruby-1.8.0            "\000 abc"
...
ruby-1.8.7-p374       "\000 abc"
ruby-1.9.0-0          "\x00 abc"
...
ruby-1.9.2-preview1   "\x00 abc"
ruby-1.9.2-preview3   "\u0000 abc"
...
ruby-2.0.0-preview2   "\u0000 abc"
ruby-2.0.0-rc1        "\0 abc"
...
ruby-2.0.0-p0         "\0 abc"
ruby-2.0.0-p195       "\u0000 abc"
...
ruby-3.0.1            "\u0000 abc"
ruby-3.0.2            "abc"
...
ruby-3.3.1            "abc"

@znz znz merged commit 5190028 into rurema:master May 15, 2024
2 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

String#strip、#strip!、#lstrip、#lstrip!のマニュアルと異なる挙動
2 participants