8000 merges r26052 from trunk into ruby_1_9_1. · documenting-ruby/ruby@34072fa · GitHub
[go: up one dir, main page]

Skip to content

Commit 34072fa

Browse files
committed
merges r26052 from trunk into ruby_1_9_1.
-- * string.c (rb_str_justify): fixed the case a fill size is a multiple of the length of the padding. [ruby-dev:39856] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@26568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 3cce74d commit 34072fa

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Wed Dec 9 09:50:35 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
2+
3+
* string.c (rb_str_justify): fixed the case a fill size is a
4+
multiple of the length of the padding. [ruby-dev:39856]
5+
16
Sat Oct 31 17:19:28 2009 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
27

38
* lib/net/http.rb (Net::HTTPResponse#each_response_header):

string.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6515,7 +6515,7 @@ rb_str_justify(int argc, VALUE *argv, VALUE str, char jflag)
65156515
p += llen;
65166516
}
65176517
else {
6518-
while (llen > fclen) {
6518+
while (llen >= fclen) {
65196519
memcpy(p,f,flen);
65206520
p += flen;
65216521
llen -= fclen;
@@ -6532,7 +6532,7 @@ rb_str_justify(int argc, VALUE *argv, VALUE str, char jflag)
65326532
p += rlen;
65336533
}
65346534
else {
6535-
while (rlen > fclen) {
6535+
while (rlen >= fclen) {
65366536
memcpy(p,f,flen);
65376537
p += flen;
65386538
rlen -= fclen;

test/ruby/test_string.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,12 @@ def test_capitalize!
320320

321321
end
322322

323+
Bug2463 = '[ruby-dev:39856]'
323324
def test_center
324325
assert_equal(S("hello"), S("hello").center(4))
325326
assert_equal(S(" hello "), S("hello").center(11))
327+
assert_equal(S("ababaababa"), S("").center(10, "ab"), Bug2463)
328+
assert_equal(S("ababaababab"), S("").center(11, "ab"), Bug2463)
326329
end
327330

328331
def test_chomp
@@ -779,6 +782,8 @@ def test_length
779782
def test_ljust
780783
assert_equal(S("hello"), S("hello").ljust(4))
781784
assert_equal(S("hello "), S("hello").ljust(11))
785+
assert_equal(S("ababababab"), S("").ljust(10, "ab"), Bug2463)
786+
assert_equal(S("abababababa"), S("").ljust(11, "ab"), Bug2463)
782787
end
783788

784789
def test_next
@@ -917,6 +922,8 @@ def o.to_str; "bar"; end
917922
def test_rjust
918923
assert_equal(S("hello"), S("hello").rjust(4))
919924
assert_equal(S(" hello"), S("hello").rjust(11))
925+
assert_equal(S("ababababab"), S("").rjust(10, "ab"), Bug2463)
926+
assert_equal(S("abababababa"), S("").rjust(11, "ab"), Bug2463)
920927
end
921928

922929
def test_scan

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define RUBY_VERSION "1.9.1"
2-
#define RUBY_PATCHLEVEL 418
2+
#define RUBY_PATCHLEVEL 419
33
#define RUBY_VERSION_MAJOR 1
44
#define RUBY_VERSION_MINOR 9
55
#define RUBY_VERSION_TEENY 1

0 commit comments

Comments
 (0)
0