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

ruby-changes:48873

From: shugo <ko1@a...>
Date: Sun, 3 Dec 2017 17:10:48 +0900 (JST)
Subject: [ruby-changes:48873] shugo:r60991 (trunk): Fix a documentation error of IO#putc.

shugo	2017-12-03 17:10:42 +0900 (Sun, 03 Dec 2017)

  New Revision: 60991

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60991

  Log:
    Fix a documentation error of IO#putc.
    
    IO#putc is multi-byte character safe when a String is given as its argument.
    [ruby-core:82019] [Bug #13741]

  Modified files:
    trunk/io.c
Index: io.c
===================================================================
--- io.c	(revision 60990)
+++ io.c	(revision 60991)
@@ -7488,10 +7488,10 @@ rb_f_print(int argc, const VALUE *argv) https://github.com/ruby/ruby/blob/trunk/io.c#L7488
  *     ios.putc(obj)    -> obj
  *
  *  If <i>obj</i> is <code>Numeric</code>, write the character whose code is
- *  the least-significant byte of <i>obj</i>, otherwise write the first byte
- *  of the string representation of <i>obj</i> to <em>ios</em>. Note: This
- *  method is not safe for use with multi-byte characters as it will truncate
- *  them.
+ *  the least-significant byte of <i>obj</i>.
+ *  If <i>obj</i> is <code>String</code>, write the first character
+ *  of <i>obj</i> to <em>ios</em>.
+ *  Otherwise, raise <code>TypeError</code>.
  *
  *     $stdout.putc "A"
  *     $stdout.putc 65

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

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