mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* string.c (rb_str_justify): [ruby-dev:25367]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a8a99b0fe5
commit
ca61cc0b23
2 changed files with 9 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Thu Dec 30 00:41:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* string.c (rb_str_justify): [ruby-dev:25367]
|
||||||
|
|
||||||
Wed Dec 29 11:07:07 2004 Dave Thomas <dave@pragprog.com>
|
Wed Dec 29 11:07:07 2004 Dave Thomas <dave@pragprog.com>
|
||||||
|
|
||||||
* lib/rdoc/generators/template/html/kilmer.rb: Update to use new
|
* lib/rdoc/generators/template/html/kilmer.rb: Update to use new
|
||||||
|
@ -47,6 +51,10 @@ Mon Dec 27 16:55:17 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
||||||
* ext/openssl/ossl_x509name.c (Init_ossl_x509name): should use
|
* ext/openssl/ossl_x509name.c (Init_ossl_x509name): should use
|
||||||
rb_hash_new to get exactly a Hash. fix [ruby-dev:25325].
|
rb_hash_new to get exactly a Hash. fix [ruby-dev:25325].
|
||||||
|
|
||||||
|
Mon Dec 27 16:29:56 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* string.c (rb_str_justify): [ruby-dev:25341]
|
||||||
|
|
||||||
Mon Dec 27 15:47:48 2004 Minero Aoki <aamine@loveruby.net>
|
Mon Dec 27 15:47:48 2004 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
* test/fileutils/fileasserts.rb: sync with HEAD.
|
* test/fileutils/fileasserts.rb: sync with HEAD.
|
||||||
|
|
2
string.c
2
string.c
|
@ -4474,7 +4474,6 @@ rb_str_justify(argc, argv, str, jflag)
|
||||||
|
|
||||||
rb_scan_args(argc, argv, "11", &w, &pad);
|
rb_scan_args(argc, argv, "11", &w, &pad);
|
||||||
width = NUM2LONG(w);
|
width = NUM2LONG(w);
|
||||||
if (width < 0 || RSTRING(str)->len >= width) return rb_str_dup(str);
|
|
||||||
if (argc == 2) {
|
if (argc == 2) {
|
||||||
StringValue(pad);
|
StringValue(pad);
|
||||||
f = RSTRING(pad)->ptr;
|
f = RSTRING(pad)->ptr;
|
||||||
|
@ -4483,6 +4482,7 @@ rb_str_justify(argc, argv, str, jflag)
|
||||||
rb_raise(rb_eArgError, "zero width padding");
|
rb_raise(rb_eArgError, "zero width padding");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (width < 0 || RSTRING(str)->len >= width) return rb_str_dup(str);
|
||||||
res = rb_str_new5(str, 0, width);
|
res = rb_str_new5(str, 0, width);
|
||||||
p = RSTRING(res)->ptr;
|
p = RSTRING(res)->ptr;
|
||||||
if (jflag != 'l') {
|
if (jflag != 'l') {
|
||||||
|
|
Loading…
Add table
Reference in a new issue