@@ -84,9 +84,9 @@ getattr(int fd, conmode *t)
8484static ID id_getc , id_close ;
8585static ID id_gets , id_flush , id_chomp_bang ;
8686
87- #ifndef HAVE_RB_ENC_INTERNED_STR_CSTR
87+ #ifndef HAVE_RB_INTERNED_STR_CSTR
8888# define rb_str_to_interned_str (str ) rb_str_freeze(str)
89- # define rb_enc_interned_str_cstr (str , enc ) rb_str_freeze(rb_usascii_str_new_cstr(str))
89+ # define rb_interned_str_cstr (str ) rb_str_freeze(rb_usascii_str_new_cstr(str))
9090#endif
9191
9292#if defined HAVE_RUBY_FIBER_SCHEDULER_H
@@ -1897,7 +1897,7 @@ console_ttyname(VALUE io)
18971897 size_t size = sizeof (termname );
18981898 int e ;
18991899 if (ttyname_r (fd , tn , size ) == 0 )
1900- return rb_enc_interned_str_cstr (tn , rb_usascii_encoding () );
1900+ return rb_interned_str_cstr (tn );
19011901 if ((e = errno ) == ERANGE ) {
19021902 VALUE s = rb_str_new (0 , size );
19031903 while (1 ) {
@@ -1921,7 +1921,7 @@ console_ttyname(VALUE io)
19211921 int e = errno ;
19221922 rb_syserr_fail_str (e , rb_sprintf ("ttyname(%d)" , fd ));
19231923 }
1924- return rb_enc_interned_str_cstr (tn , rb_usascii_encoding () );
1924+ return rb_interned_str_cstr (tn );
19251925 }
19261926# else
19271927# error No ttyname function
0 commit comments