[前][次][番号順一覧][スレッド一覧]

ruby-changes:55720

From: Nobuyoshi <ko1@a...>
Date: Tue, 14 May 2019 14:50:42 +0900 (JST)
Subject: [ruby-changes:55720] Nobuyoshi Nakada: 29dde62605 (trunk): io/console: rb_str_cat_conv_enc_opts is not exported

https://git.ruby-lang.org/ruby.git/commit/?id=29dde62605

From 29dde62605d50a55933ec5d92bcb6f5f738c390b Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 14 May 2019 14:47:54 +0900
Subject: io/console: rb_str_cat_conv_enc_opts is not exported


diff --git a/ext/io/console/console.c b/ext/io/console/console.c
index b8b3624..f10b1e4 100644
--- a/ext/io/console/console.c
+++ b/ext/io/console/console.c
@@ -443,14 +443,12 @@ console_getch(int argc, VALUE *argv, VALUE io) https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L443
 	len = 1;
 	do {
 	    buf[len++] = (unsigned char)c;
-	} while ((c >>= CHAR_BIT) && len < sizeof(buf));
+	} while ((c >>= CHAR_BIT) && len < (int)sizeof(buf));
 	return rb_str_new(buf, len);
       default:
 	len = rb_uv_to_utf8(buf, c);
-	str = rb_enc_str_new(0, 0, rb_default_external_encoding());
-	rb_str_cat_conv_enc_opts(str, 0, buf, len, rb_utf8_encoding(),
-				 0, Qnil);
-	return str;
+	str = rb_utf8_str_new(buf, len);
+	return rb_str_conv_enc(str, NULL, rb_default_external_encoding());
     }
 #endif
 }
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]