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

* lib/irb/init.rb (IRB::IRB.parse_opts): add -I option to

irb. [ruby-dev:39243]

* sprintf.c (rb_f_sprintf): sign bit extension should not be done
  if FPLUS flag is specified.  [ruby-list:39224]

* sprintf.c (rb_f_sprintf): do not prepend dots for negative
  numbers if FZERO is specified.  [ruby-dev:39218]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2004-02-20 10:03:47 +00:00
parent 611bb8f5a8
commit 50b775851a
5 changed files with 21 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Fri Feb 20 18:59:47 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/irb/init.rb (IRB::IRB.parse_opts): add -I option to
irb. [ruby-dev:39243]
Fri Feb 20 12:55:27 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (pipe_open): fix typo.
@ -94,6 +99,14 @@ Wed Feb 18 17:18:01 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* ext/win32ole/win32ole.c: need to include <olectl.h> on Cygwin.
Wed Feb 18 10:40:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* sprintf.c (rb_f_sprintf): sign bit extension should not be done
if FPLUS flag is specified. [ruby-list:39224]
* sprintf.c (rb_f_sprintf): do not prepend dots for negative
numbers if FZERO is specified. [ruby-dev:39218]
Wed Feb 18 10:23:34 2004 NAKAMURA Usaku <usa@ruby-lang.org>
* sprintf.c (rb_f_sprintf): clean up.

View file

@ -126,6 +126,9 @@ module IRB
when "-r"
opt = ARGV.shift
@CONF[:LOAD_MODULES].push opt if opt
when "-I"
opt = ARGV.shift
$LOAD_PATH.push opt if opt
when /^-K(.)/
$KCODE = $1
when "--inspect"

View file

@ -14,6 +14,7 @@ Usage: irb.rb [options] [programfile] [arguments]
-m Bc mode (load mathn, fraction or matrix are available)
-d Set $DEBUG to true (same as `ruby -d')
-r load-module Same as `ruby -r'
-I path Specify $LOAD_PATH directory
--inspect Use `inspect' for output (default except for bc mode)
--noinspect Don't use inspect for output
--readline Use Readline extension module

View file

@ -14,6 +14,7 @@ Usage: irb.rb [options] [programfile] [arguments]
-m bc$B%b!<%I(B($BJ,?t(B, $B9TNs$N7W;;$,$G$-$k(B)
-d $DEBUG $B$r(Btrue$B$K$9$k(B(ruby -d $B$HF1$8(B)
-r load-module ruby -r $B$HF1$8(B.
-I path $LOAD_PATH $B$K(B path $B$rDI2C$9$k(B.
--inspect $B7k2L=PNO$K(Binspect$B$rMQ$$$k(B(bc$B%b!<%I0J30$O%G%U%)%k%H(B).
--noinspect $B7k2L=PNO$K(Binspect$B$rMQ$$$J$$(B.
--readline readline$B%i%$%V%i%j$rMxMQ$9$k(B.

View file

@ -544,7 +544,7 @@ rb_f_sprintf(argc, argv)
if (base == 10) {
rb_warning("negative number for %%u specifier");
}
else if (!(flags&FPREC)) {
else if (!(flags&(FPREC|FZERO))) {
strcpy(s, "..");
s += 2;
}
@ -602,7 +602,7 @@ rb_f_sprintf(argc, argv)
remove_sign_bits(++s, base);
tmp = rb_str_new(0, 3+strlen(s));
t = RSTRING(tmp)->ptr;
if (!(flags&FPREC)) {
if (!(flags&(FPREC|FZERO))) {
strcpy(t, "..");
t += 2;
}
@ -660,7 +660,7 @@ rb_f_sprintf(argc, argv)
else {
char c;
if (bignum && !RBIGNUM(val)->sign)
if (!sign && bignum && !RBIGNUM(val)->sign)
c = sign_bits(base, p);
else
c = '0';