summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--COPYING2
-rw-r--r--ChangeLog11
-rw-r--r--Makefile.in2
-rw-r--r--README2
-rw-r--r--README.ja2
-rw-r--r--eval.c14
-rw-r--r--ext/digest/MANIFEST19
-rw-r--r--numeric.c14
-rw-r--r--process.c56
-rw-r--r--ruby.14
-rw-r--r--version.h4
11 files changed, 72 insertions, 58 deletions
diff --git a/COPYING b/COPYING
index 23e12f76a0..776b142468 100644
--- a/COPYING
+++ b/COPYING
@@ -1,4 +1,4 @@
-Ruby is copyrighted free software by Yukihiro Matsumoto <matz@zetabits.com>.
+Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
You can redistribute it and/or modify it under either the terms of the GPL
(see the file GPL), or the conditions below:
diff --git a/ChangeLog b/ChangeLog
index ddbb0def92..b3bc0c3134 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,17 @@ Sat Sep 8 07:13:42 2001 Wakou Aoyama <wakou@fsinet.or.jp>
* lib/net/telnet.rb: waitfor(): improvement. thanks to
nobu.nakada@nifty.ne.jp
+Sat Sep 8 04:34:17 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (rb_thread_restore_context): save current value of
+ lastline and lastmatch in the thread struct for later restore.
+
+ * eval.c (rb_thread_save_context): restore lastline and lastmatch.
+
+Fri Sep 7 11:27:56 2001 akira yamada <akira@ruby-lang.org>
+
+ * numeric.c (flo_to_s): should handle negative float value.
+
Fri Sep 7 09:44:44 2001 Wakou Aoyama <wakou@fsinet.or.jp>
* lib/net/telnet.rb: waitfor(): bug fix.
diff --git a/Makefile.in b/Makefile.in
index 37f644d786..0f7c772322 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -121,7 +121,7 @@ realclean: distclean
@rm -f parse.c
@rm -f lex.c
-test: miniruby$(EXEEXT)
+test: miniruby$(EXEEXT) rbconfig.rb
@./miniruby$(EXEEXT) $(srcdir)/rubytest.rb
rbconfig.rb: miniruby$(EXEEXT) $(srcdir)/mkconfig.rb config.status
diff --git a/README b/README
index 6a008e998e..bde22dff78 100644
--- a/README
+++ b/README
@@ -97,7 +97,7 @@ See the file COPYING.
Feel free to send comments and bug reports to the author. Here is the
author's latest mail address:
- matz@zetabits.com
+ matz@netlab.jp
-------------------------------------------------------
created at: Thu Aug 3 11:57:36 JST 1995
diff --git a/README.ja b/README.ja
index be89ce1935..fc502dd440 100644
--- a/README.ja
+++ b/README.ja
@@ -145,7 +145,7 @@ COPYING.jaファイルを参照してください。
* 著者
-コメント,バグレポートその他は matz@zetabits.com まで.
+コメント,バグレポートその他は matz@netlab.jp まで.
-------------------------------------------------------
created at: Thu Aug 3 11:57:36 JST 1995
Local variables:
diff --git a/eval.c b/eval.c
index 78cb432967..1f6f9f4352 100644
--- a/eval.c
+++ b/eval.c
@@ -7154,6 +7154,7 @@ rb_thread_save_context(th)
{
VALUE *pos;
int len;
+ static VALUE tval;
len = stack_length(&pos);
th->stk_len = 0;
@@ -7181,8 +7182,12 @@ rb_thread_save_context(th)
th->tracing = tracing;
th->errinfo = ruby_errinfo;
th->last_status = rb_last_status;
- th->last_line = rb_lastline_get();
- th->last_match = rb_backref_get();
+ tval = rb_lastline_get();
+ rb_lastline_set(th->last_line);
+ th->last_line = tval;
+ tval = rb_backref_get();
+ rb_backref_set(th->last_match);
+ th->last_match = tval;
th->safe = ruby_safe_level;
th->file = ruby_sourcefile;
@@ -7246,6 +7251,7 @@ rb_thread_restore_context(th, exit)
VALUE v;
static rb_thread_t tmp;
static int ex;
+ static VALUE tval;
if (!th->stk_ptr) rb_bug("unsaved context");
@@ -7282,8 +7288,12 @@ rb_thread_restore_context(th, exit)
FLUSH_REGISTER_WINDOWS;
MEMCPY(tmp->stk_pos, tmp->stk_ptr, VALUE, tmp->stk_len);
+ tval = rb_lastline_get();
rb_lastline_set(tmp->last_line);
+ tmp->last_line = tval;
+ tval = rb_backref_get();
rb_backref_set(tmp->last_match);
+ tmp->last_match = tval;
longjmp(tmp->context, ex);
}
diff --git a/ext/digest/MANIFEST b/ext/digest/MANIFEST
index e379b30d22..bf7cfefce3 100644
--- a/ext/digest/MANIFEST
+++ b/ext/digest/MANIFEST
@@ -7,24 +7,5 @@ digest.txt.ja
extconf.rb
lib/md5.rb
lib/sha1.rb
-md5/extconf.rb
-md5/md5.c
-md5/md5.h
-md5/md5init.c
-rmd160/extconf.rb
-rmd160/rmd160.c
-rmd160/rmd160.h
-rmd160/rmd160hl.c
-rmd160/rmd160init.c
-sha1/extconf.rb
-sha1/sha1.c
-sha1/sha1.h
-sha1/sha1hl.c
-sha1/sha1init.c
-sha2/extconf.rb
-sha2/sha2.c
-sha2/sha2.h
-sha2/sha2hl.c
-sha2/sha2init.c
test.rb
test.sh
diff --git a/numeric.c b/numeric.c
index 757667ef09..1044071009 100644
--- a/numeric.c
+++ b/numeric.c
@@ -210,21 +210,25 @@ flo_to_s(flt)
char buf[24];
char *fmt = "%.10g";
double value = RFLOAT(flt)->value;
- double d1, d2;
+ double avalue, d1, d2;
if (isinf(value))
return rb_str_new2(value < 0 ? "-Infinity" : "Infinity");
else if(isnan(value))
return rb_str_new2("NaN");
- if (value < 1.0e-3) {
- d1 = value;
+ avalue = fabs(value);
+ if (avalue == 0.0) {
+ fmt = "%.1f";
+ }
+ else if (avalue < 1.0e-3) {
+ d1 = avalue;
while (d1 < 1.0) d1 *= 10.0;
d1 = modf(d1, &d2);
if (d1 == 0) fmt = "%.1e";
}
- else if (value >= 1.0e10) {
- d1 = value;
+ else if (avalue >= 1.0e10) {
+ d1 = avalue;
while (d1 > 10.0) d1 /= 10.0;
d1 = modf(d1, &d2);
if (d1 == 0) fmt = "%.1e";
diff --git a/process.c b/process.c
index 90153977b8..431f9f50e0 100644
--- a/process.c
+++ b/process.c
@@ -953,16 +953,18 @@ proc_setuid(obj, id)
uid = NUM2INT(id);
#ifdef HAVE_SETREUID
- setreuid(uid, -1);
+ if (setreuid(uid, -1) < 0) rb_sys_fail(0);
#else
#ifdef HAVE_SETRUID
- setruid(uid);
+ if (setruid(uid) < 0) rb_sys_fail(0);
#else
{
- if (geteuid() == uid)
- setuid(uid);
- else
+ if (geteuid() == uid) {
+ if (setuid(uid) < 0) rb_sys_fail(0);
+ }
+ else {
rb_notimplement();
+ }
}
#endif
#endif
@@ -984,17 +986,19 @@ proc_setgid(obj, id)
int gid;
gid = NUM2INT(id);
-#ifdef HAS_SETRGID
- setrgid((GIDTYPE)gid);
-#else
#ifdef HAVE_SETREGID
- setregid(gid, -1);
+ if (setregid(gid, -1) < 0) rb_sys_fail(0);
+#else
+#ifdef HAS_SETRGID
+ if (setrgid((GIDTYPE)gid) < 0) rb_sys_fail(0);
#else
{
- if (getegid() == gid)
- setgid(gid);
- else
+ if (getegid() == gid) {
+ if (setgid(gid) < 0) rb_sys_fail(0);
+ }
+ else {
rb_notimplement();
+ }
}
#endif
#endif
@@ -1013,17 +1017,19 @@ static VALUE
proc_seteuid(obj, euid)
VALUE obj, euid;
{
-#ifdef HAVE_SETEUID
- if (seteuid(NUM2INT(euid)) < 0) rb_sys_fail(0);
-#else
#ifdef HAVE_SETREUID
if (setreuid(-1, NUM2INT(euid)) < 0) rb_sys_fail(0);
#else
+#ifdef HAVE_SETEUID
+ if (seteuid(NUM2INT(euid)) < 0) rb_sys_fail(0);
+#else
euid = NUM2INT(euid);
- if (euid == getuid())
- setuid(euid);
- else
+ if (euid == getuid()) {
+ if (setuid(euid) < 0) rb_sys_fail(0);
+ }
+ else {
rb_notimplement();
+ }
#endif
#endif
return euid;
@@ -1042,17 +1048,19 @@ proc_setegid(obj, egid)
VALUE obj, egid;
{
rb_secure(2);
-#ifdef HAVE_SETEGID
- if (setegid(NUM2INT(egid)) < 0) rb_sys_fail(0);
-#else
#ifdef HAVE_SETREGID
if (setregid(-1, NUM2INT(egid)) < 0) rb_sys_fail(0);
#else
+#ifdef HAVE_SETEGID
+ if (setegid(NUM2INT(egid)) < 0) rb_sys_fail(0);
+#else
egid = NUM2INT(egid);
- if (egid == getgid())
- setgid(egid);
- else
+ if (egid == getgid()) {
+ if (setgid(egid) < 0) rb_sys_fail(0);
+ }
+ else {
rb_notimplement();
+ }
#endif
#endif
return egid;
diff --git a/ruby.1 b/ruby.1
index 30126d4e2e..6d6bebf1ae 100644
--- a/ruby.1
+++ b/ruby.1
@@ -1,4 +1,4 @@
-.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@zetabits.com>.
+.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@netlab.jp>.
.na
.TH RUBY 1 "ruby 1.6" "2000-09-11" "Ruby Programmers Reference Guide"
.SH NAME
@@ -288,4 +288,4 @@ state messages during compiling scripts. You don't have to specify
this switch, unless you are going to debug the Ruby interpreter.
.PP
.SH AUTHOR
- Ruby is designed and implemented by Yukihiro Matsumoto <matz@zetabits.com>.
+ Ruby is designed and implemented by Yukihiro Matsumoto <matz@netlab.jp>.
diff --git a/version.h b/version.h
index 1f0f63cee5..3e073ee529 100644
--- a/version.h
+++ b/version.h
@@ -1,4 +1,4 @@
#define RUBY_VERSION "1.6.5"
-#define RUBY_RELEASE_DATE "2001-09-06"
+#define RUBY_RELEASE_DATE "2001-09-08"
#define RUBY_VERSION_CODE 165
-#define RUBY_RELEASE_CODE 20010906
+#define RUBY_RELEASE_CODE 20010908