<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/stringio/test_stringio.rb, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/stringio] Copy from the relocated string</title>
<updated>2024-11-05T05:01:03+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-10-26T12:56:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=348a53415339076afc4a02fcd09f3ae36e9c4c61'/>
<id>348a53415339076afc4a02fcd09f3ae36e9c4c61</id>
<content type='text'>
When ungetting the string same as the same buffer string, extending
the buffer can move the pointer in the argument.  Reported by manun
Manu (manun) at https://hackerone.com/reports/2805165.

https://github.com/ruby/stringio/commit/95c1194832
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When ungetting the string same as the same buffer string, extending
the buffer can move the pointer in the argument.  Reported by manun
Manu (manun) at https://hackerone.com/reports/2805165.

https://github.com/ruby/stringio/commit/95c1194832
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/stringio] Remove special handling of chilled strings</title>
<updated>2024-05-30T15:11:48+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2024-05-30T12:41:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=15501e13d7588a049437d343548bda76121b92f9'/>
<id>15501e13d7588a049437d343548bda76121b92f9</id>
<content type='text'>
[Feature #20205]

Followup: https://github.com/ruby/stringio/pull/94

They no longer need to be special cases. If StringIO end up
mutating a chilled string, a warning will be emitted.

https://github.com/ruby/stringio/commit/dc62d65449
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Feature #20205]

Followup: https://github.com/ruby/stringio/pull/94

They no longer need to be special cases. If StringIO end up
mutating a chilled string, a warning will be emitted.

https://github.com/ruby/stringio/commit/dc62d65449
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/stringio] strio_read: preserve buffer encoding on partial</title>
<updated>2024-04-17T01:29:18+00:00</updated>
<author>
<name>Jean byroot Boussier</name>
<email>jean.boussier+github@shopify.com</email>
</author>
<published>2024-04-17T01:29:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=75154dec73e1329693866e3a88cb9febb7635417'/>
<id>75154dec73e1329693866e3a88cb9febb7635417</id>
<content type='text'>
reads
(https://github.com/ruby/stringio/pull/95)

[[Bug #20418]](https://bugs.ruby-lang.org/issues/20418)

Ruby IO#read preserves the encoding on partial read, but change it when
reading the whole IO

from commit https://github.com/ruby/ruby/commit/0ca7036682da:
&gt; * io.c (read_all): should associate default external encoding.
&gt; * io.c (io_read): should NOT associate default external encoding.

https://github.com/ruby/stringio/commit/073172da31

Co-authored-by: Jean Boussier &lt;jean.boussier@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
reads
(https://github.com/ruby/stringio/pull/95)

[[Bug #20418]](https://bugs.ruby-lang.org/issues/20418)

Ruby IO#read preserves the encoding on partial read, but change it when
reading the whole IO

from commit https://github.com/ruby/ruby/commit/0ca7036682da:
&gt; * io.c (read_all): should associate default external encoding.
&gt; * io.c (io_read): should NOT associate default external encoding.

https://github.com/ruby/stringio/commit/073172da31

Co-authored-by: Jean Boussier &lt;jean.boussier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/stringio] Eagerly defrost chilled strings</title>
<updated>2024-03-27T17:27:19+00:00</updated>
<author>
<name>Étienne Barrié</name>
<email>etienne.barrie@gmail.com</email>
</author>
<published>2024-03-27T16:57:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0f5ab4ad5289d6385b74e800a73de005a48737b6'/>
<id>0f5ab4ad5289d6385b74e800a73de005a48737b6</id>
<content type='text'>
[Feature #20390]

https://github.com/ruby/stringio/commit/17ee957f34

Co-authored-by: Jean Boussier &lt;byroot@ruby-lang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Feature #20390]

https://github.com/ruby/stringio/commit/17ee957f34

Co-authored-by: Jean Boussier &lt;byroot@ruby-lang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/stringio] NULL StringIO by `StringIO.new(nil)`</title>
<updated>2024-03-15T04:34:14+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-06-30T15:57:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a1ced60692022184d40bdbb980131705e6be4fda'/>
<id>a1ced60692022184d40bdbb980131705e6be4fda</id>
<content type='text'>
https://github.com/ruby/stringio/commit/779f71359d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/stringio/commit/779f71359d
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/stringio] Define `StringIO::MAX_LENGTH`</title>
<updated>2024-03-13T13:20:23+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-03-13T10:13:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3f8ef7ff7c09e67a48eff33804060803b9f11119'/>
<id>3f8ef7ff7c09e67a48eff33804060803b9f11119</id>
<content type='text'>
https://github.com/ruby/stringio/commit/0205bd1c86
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/stringio/commit/0205bd1c86
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/stringio] Various cleanup for JRuby ext</title>
<updated>2024-03-13T04:46:54+00:00</updated>
<author>
<name>Charles Oliver Nutter</name>
<email>headius@headius.com</email>
</author>
<published>2024-03-13T04:46:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0b7487b44ecc0f95dcc8bfa0fdf7d5915dcc0f8f'/>
<id>0b7487b44ecc0f95dcc8bfa0fdf7d5915dcc0f8f</id>
<content type='text'>
(https://github.com/ruby/stringio/pull/85)

* Fix compile warnings on latest Java.
* Adjust one test for JRuby erroring on bad pos= value.
* Replace hard JVM synchronization with a spin lock.
* Avoid duplicate reads of state fields where possible.
* Remove long-deprecated codepoints, chars, bytes, lines methods.
* Mark fcntl as not implemented
* Split most of the remaining variable-arity methods.

https://github.com/ruby/stringio/commit/31a9d42e6c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/stringio/pull/85)

* Fix compile warnings on latest Java.
* Adjust one test for JRuby erroring on bad pos= value.
* Replace hard JVM synchronization with a spin lock.
* Avoid duplicate reads of state fields where possible.
* Remove long-deprecated codepoints, chars, bytes, lines methods.
* Mark fcntl as not implemented
* Split most of the remaining variable-arity methods.

https://github.com/ruby/stringio/commit/31a9d42e6c
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/stringio] Fix ascii_only? flag in strio_write</title>
<updated>2024-01-18T03:42:21+00:00</updated>
<author>
<name>tomoya ishida</name>
<email>tomoyapenguin@gmail.com</email>
</author>
<published>2024-01-18T03:42:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fd1bafc11f74cb2bb74bf97bcba4ef694a533aec'/>
<id>fd1bafc11f74cb2bb74bf97bcba4ef694a533aec</id>
<content type='text'>
(https://github.com/ruby/stringio/pull/77)

Followup of #79

`rb_str_resize()` was changed by https://github.com/ruby/ruby/commit/b0b9f7201acab05c2a3ad92c3043a1f01df3e17f  .

```c
rb_str_resize(string, shorter) // clear ENC_CODERANGE in some case
rb_str_resize(string, longer) // does not clear ENC_CODERANGE anymore
```

```c
// rb_str_resize in string.c
if (slen &gt; len &amp;&amp; ENC_CODERANGE(str) != ENC_CODERANGE_7BIT) {
  ENC_CODERANGE_CLEAR(str);
}
```

I think this change is based on an assumption that appending null bytes
will not change flag `ascii_only?`.

`strio_extend()` will make the string longer if needed, and update the
flags correctly for appending null bytes.
Before `memmove()`, we need to `rb_str_modify()` because updated flags are not
updated for `memmove()`.

https://github.com/ruby/stringio/commit/b31a538576
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/stringio/pull/77)

Followup of #79

`rb_str_resize()` was changed by https://github.com/ruby/ruby/commit/b0b9f7201acab05c2a3ad92c3043a1f01df3e17f  .

```c
rb_str_resize(string, shorter) // clear ENC_CODERANGE in some case
rb_str_resize(string, longer) // does not clear ENC_CODERANGE anymore
```

```c
// rb_str_resize in string.c
if (slen &gt; len &amp;&amp; ENC_CODERANGE(str) != ENC_CODERANGE_7BIT) {
  ENC_CODERANGE_CLEAR(str);
}
```

I think this change is based on an assumption that appending null bytes
will not change flag `ascii_only?`.

`strio_extend()` will make the string longer if needed, and update the
flags correctly for appending null bytes.
Before `memmove()`, we need to `rb_str_modify()` because updated flags are not
updated for `memmove()`.

https://github.com/ruby/stringio/commit/b31a538576
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/stringio] Update the coderange after overwrite</title>
<updated>2024-01-16T15:06:22+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-01-16T14:59:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6283ae8d369bd2f8a022bb69bc5b742c58529dec'/>
<id>6283ae8d369bd2f8a022bb69bc5b742c58529dec</id>
<content type='text'>
Fix https://bugs.ruby-lang.org/issues/20185

https://github.com/ruby/stringio/commit/8230552a46
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix https://bugs.ruby-lang.org/issues/20185

https://github.com/ruby/stringio/commit/8230552a46
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/stringio] Add missing row separator encoding conversion</title>
<updated>2023-11-08T00:46:17+00:00</updated>
<author>
<name>Sutou Kouhei</name>
<email>kou@clear-code.com</email>
</author>
<published>2023-11-08T00:46:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7ed37388fb9c0e85325b4e3db2ffbfca3f4179ad'/>
<id>7ed37388fb9c0e85325b4e3db2ffbfca3f4179ad</id>
<content type='text'>
(https://github.com/ruby/stringio/pull/69)

The conversion logic is borrowed from ruby/ruby's io.c:
https://github.com/ruby/ruby/blob/40391faeab608665da87a05c686c074f91a5a206/io.c#L4059-L4079

Fix ruby/stringio#68

Reported by IWAMOTO Kouichi. Thanks!!!

https://github.com/ruby/stringio/commit/4b170c1a68
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/stringio/pull/69)

The conversion logic is borrowed from ruby/ruby's io.c:
https://github.com/ruby/ruby/blob/40391faeab608665da87a05c686c074f91a5a206/io.c#L4059-L4079

Fix ruby/stringio#68

Reported by IWAMOTO Kouichi. Thanks!!!

https://github.com/ruby/stringio/commit/4b170c1a68
</pre>
</div>
</content>
</entry>
</feed>
