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

ruby-changes:17531

From: naruse <ko1@a...>
Date: Tue, 19 Oct 2010 19:34:19 +0900 (JST)
Subject: [ruby-changes:17531] Ruby:r29536 (trunk): * vsnprintf.c (BSD_vfprintf): clear ALT flag for %a.

naruse	2010-10-19 19:34:13 +0900 (Tue, 19 Oct 2010)

  New Revision: 29536

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29536

  Log:
    * vsnprintf.c (BSD_vfprintf): clear ALT flag for %a.
      [ruby-core:32841] [ruby-core:32848]

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_sprintf.rb
    trunk/vsnprintf.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29535)
+++ ChangeLog	(revision 29536)
@@ -1,3 +1,8 @@
+Tue Oct 19 19:30:11 2010  NARUSE, Yui  <naruse@r...>
+
+	* vsnprintf.c (BSD_vfprintf): clear ALT flag for %a.
+	  [ruby-core:32841] [ruby-core:32848]
+
 Tue Oct 19 12:19:25 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* vsnprintf.c (BSD_vfprintf): fix over-count of field size.
Index: vsnprintf.c
===================================================================
--- vsnprintf.c	(revision 29535)
+++ vsnprintf.c	(revision 29536)
@@ -784,6 +784,7 @@
 #ifdef FLOATING_POINT
 		case 'a':
 		case 'A':
+			flags &= ~ALT;
 			if (prec >= 0)
 				prec++;
 			goto fp_begin;
Index: test/ruby/test_sprintf.rb
===================================================================
--- test/ruby/test_sprintf.rb	(revision 29535)
+++ test/ruby/test_sprintf.rb	(revision 29536)
@@ -221,8 +221,10 @@
     assert_equal("-0x1.08p+0", sprintf("%010a", -1.03125), bug3962)
 
     bug3964 = '[ruby-core:32848]'
+    assert_equal("0x000000000000000p+0", sprintf("%020a",  0), bug3962)
     assert_equal("0x000000000000001p+0", sprintf("%020a", 1), bug3964)
     assert_equal("-0x00000000000001p+0", sprintf("%020a", -1), bug3964)
+    assert_equal("0x000000000000000p+0", sprintf("%#020a",  0), bug3962)
   end
 
   BSIZ = 120

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

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