1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* string.c (rb_str_justify): create buffer string after argument type

conversion.  fixed: [ruby-dev:25341]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2004-12-28 13:32:28 +00:00
parent ecb09c186e
commit afd7aea857
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Tue Dec 28 22:31:46 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (rb_str_justify): create buffer string after argument type
conversion. fixed: [ruby-dev:25341]
Tue Dec 28 17:18:17 2004 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/net/telnet.rb (preprocess): remove NULL unless binmode.

View file

@ -4505,7 +4505,6 @@ rb_str_justify(argc, argv, str, jflag)
rb_scan_args(argc, argv, "11", &w, &pad);
width = NUM2LONG(w);
if (width < 0 || RSTRING(str)->len >= width) return rb_str_dup(str);
res = rb_str_new5(str, 0, width);
if (argc == 2) {
StringValue(pad);
f = RSTRING(pad)->ptr;
@ -4514,6 +4513,7 @@ rb_str_justify(argc, argv, str, jflag)
rb_raise(rb_eArgError, "zero width padding");
}
}
res = rb_str_new5(str, 0, width);
p = RSTRING(res)->ptr;
if (jflag != 'l') {
n = width - RSTRING(str)->len;