diff --git a/ChangeLog b/ChangeLog index 412cd3bd45..8f19057652 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Feb 20 18:59:47 2004 Yukihiro Matsumoto + + * 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 * io.c (pipe_open): fix typo. @@ -94,6 +99,14 @@ Wed Feb 18 17:18:01 2004 WATANABE Hirofumi * ext/win32ole/win32ole.c: need to include on Cygwin. +Wed Feb 18 10:40:38 2004 Yukihiro Matsumoto + + * 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 * sprintf.c (rb_f_sprintf): clean up. diff --git a/lib/irb/init.rb b/lib/irb/init.rb index 1df2926fa5..8b6ff6264d 100644 --- a/lib/irb/init.rb +++ b/lib/irb/init.rb @@ -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" diff --git a/lib/irb/lc/help-message b/lib/irb/lc/help-message index 42e861a343..efc00bf148 100644 --- a/lib/irb/lc/help-message +++ b/lib/irb/lc/help-message @@ -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 diff --git a/lib/irb/lc/ja/help-message b/lib/irb/lc/ja/help-message index 1cf980f6ba..4b710c7788 100644 --- a/lib/irb/lc/ja/help-message +++ b/lib/irb/lc/ja/help-message @@ -14,6 +14,7 @@ Usage: irb.rb [options] [programfile] [arguments] -m bcモード(分数, 行列の計算ができる) -d $DEBUG をtrueにする(ruby -d と同じ) -r load-module ruby -r と同じ. + -I path $LOAD_PATH に path を追加する. --inspect 結果出力にinspectを用いる(bcモード以外はデフォルト). --noinspect 結果出力にinspectを用いない. --readline readlineライブラリを利用する. diff --git a/sprintf.c b/sprintf.c index 73282b88a2..6de45618c8 100644 --- a/sprintf.c +++ b/sprintf.c @@ -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';