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

ruby-changes:8876

From: yugui <ko1@a...>
Date: Sun, 30 Nov 2008 18:24:51 +0900 (JST)
Subject: [ruby-changes:8876] Ruby:r20413 (ruby_1_9_1): merges r20355 from trunk into ruby_1_9_1.

yugui	2008-11-30 18:23:23 +0900 (Sun, 30 Nov 2008)

  New Revision: 20413

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

  Log:
    merges r20355 from trunk into ruby_1_9_1.
    * strftime.c (rb_strftime): should not swallow incomplete
      formatter, e.g. "%E".  [ruby-dev:37170] fix: #787
    * strftime.c (rb_strftime): clear flags before processing unknown
      formatter, e.g. "%i".  [ruby-dev:37180]

  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/strftime.c

Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 20412)
+++ ruby_1_9_1/ChangeLog	(revision 20413)
@@ -1,3 +1,11 @@
+Tue Nov 25 15:54:07 2008  Yukihiro Matsumoto  <matz@r...>
+
+	* strftime.c (rb_strftime): should not swallow incomplete
+	  formatter, e.g. "%E".  [ruby-dev:37170] fix: #787
+
+	* strftime.c (rb_strftime): clear flags before processing unknown
+	  formatter, e.g. "%i".  [ruby-dev:37180]
+
 Tue Nov 25 10:35:29 2008  Yukihiro Matsumoto  <matz@r...>
 
 	* strftime.c (rb_strftime): "%^P" should convert to upper case.
Index: ruby_1_9_1/strftime.c
===================================================================
--- ruby_1_9_1/strftime.c	(revision 20412)
+++ ruby_1_9_1/strftime.c	(revision 20413)
@@ -310,8 +310,8 @@
 	again:
 		switch (*++format) {
 		case '\0':
-			*s++ = '%';
-			goto out;
+			format--;
+			goto unknown;
 
 		case '%':
 			*s++ = '%';
@@ -762,8 +762,11 @@
 
 		default:
 		unknown:
+			i = format - sp + 1;
 			tp = sp;
-			i = format - sp + 1;
+			precision = -1;
+			flags = 0;
+			padding = 0;
 			break;
 		}
 		if (i) {
@@ -786,7 +789,6 @@
 			}
 		}
 	}
-out:
 	if (s >= endp) {
 		goto err;
 	}

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

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