aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-02 04:46:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-02 04:46:41 +0000
commit46e848a65a866663161edecc81d1b46aa3e36de3 (patch)
tree39edd93b75f3af6a3c8c5e59bbbd09794105a916
parent12b1e59f2eacd346da550bbc30cc3644909cb314 (diff)
downloadruby-46e848a65a866663161edecc81d1b46aa3e36de3.tar.gz
* sprintf.c (rb_f_sprintf): should not check positional number as
width. [ruby-core:11838] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--sprintf.c2
-rw-r--r--test/ruby/test_sprintf.rb4
-rw-r--r--version.h6
4 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index bfc1bc3add..413ac8c9cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Aug 2 13:46:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * sprintf.c (rb_f_sprintf): should not check positional number as
+ width. [ruby-core:11838]
+
Wed Aug 1 12:40:05 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* generic.rb (URI::Generic::merge_path): behave as RFC 3986.
diff --git a/sprintf.c b/sprintf.c
index 069f6fbf93..78438bf55b 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -349,7 +349,6 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
- CHECK_FOR_WIDTH(flags);
n = 0;
GETNUM(n, width);
if (*p == '$') {
@@ -360,6 +359,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
p++;
goto retry;
}
+ CHECK_FOR_WIDTH(flags);
width = n;
flags |= FWIDTH;
goto retry;
diff --git a/test/ruby/test_sprintf.rb b/test/ruby/test_sprintf.rb
index 5e0b763e99..018486baae 100644
--- a/test/ruby/test_sprintf.rb
+++ b/test/ruby/test_sprintf.rb
@@ -1,6 +1,10 @@
require 'test/unit'
class TestSprintf < Test::Unit::TestCase
+ def test_positional
+ assert_equal(" 00001", sprintf("%*1$.*2$3$d", 10, 5, 1))
+ end
+
def test_binary
assert_equal("0", sprintf("%b", 0))
assert_equal("1", sprintf("%b", 1))
diff --git a/version.h b/version.h
index 09aef04f12..2a87aa5b1a 100644
--- a/version.h
+++ b/version.h
@@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0"
-#define RUBY_RELEASE_DATE "2007-08-01"
+#define RUBY_RELEASE_DATE "2007-08-02"
#define RUBY_VERSION_CODE 190
-#define RUBY_RELEASE_CODE 20070801
+#define RUBY_RELEASE_CODE 20070802
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
@@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 8
-#define RUBY_RELEASE_DAY 1
+#define RUBY_RELEASE_DAY 2
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];