summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorJeremy Evans <[email protected]>2025-04-14 18:51:59 -0700
committergit <[email protected]>2025-05-13 03:20:09 +0000
commit18d395e0784401585b5c14300e689de55e208647 ()
tree7a92a717eb9ea461610a4b3df4cb4e3c35315449 /ext
parent9b8c846bdf4ae2f218e0b92d0898d7206d0002c9 (diff)
[ruby/stringio] Do not issue warning when calling set_encoding if string is chilled
StringIO does not warn for unchilled unfrozen string or for frozen string, so it should not warn for chilled string. https://.com/ruby/stringio/commit/4ac33b8c70
-rw-r--r--ext/stringio/stringio.c8
1 files changed, 7 insertions, 1 deletions
@@ -20,6 +20,7 @@ STRINGIO_VERSION = "3.1.8.dev";
#include "ruby.h"
#include "ruby/io.h"
#include "ruby/encoding.h"
#if defined(HAVE_FCNTL_H) || defined(_WIN32)
#include <fcntl.h>
#elif defined(HAVE_SYS_FCNTL_H)
@@ -1864,7 +1865,12 @@ strio_set_encoding(int argc, VALUE *argv, VALUE self)
}
}
ptr->enc = enc;
- if (!NIL_P(ptr->string) && WRITABLE(self)) {
rb_enc_associate(ptr->string, enc);
}