summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-02-16 03:42:20 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-02-16 03:42:20 +0000
commitec82e48deb8fb294bda58afb5a93b0b69817e305 (patch)
tree5d8277bfa20f0d9fe102d68bd9211008e8ae446b
parentbcec81835dc263b933f2629aa5329f6c943da60d (diff)
1.2.3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog12
-rw-r--r--ext/tk/lib/tk.rb1
-rw-r--r--lib/date2.rb24
-rw-r--r--lib/weakref.rb7
-rw-r--r--regex.c20
-rw-r--r--sample/cal.rb7
-rw-r--r--version.h2
7 files changed, 50 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index 7f50ea0600..163aadc75c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Tue Feb 16 12:40:55 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * version 1.2.3 (stable) released.
+
+Wed Feb 10 15:20:03 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * regex.c (re_match): empty pattern should not cause infinite
+ pattern match loop.
+
+ * regex.c (re_compile_pattern): RE_OPTIMIZE_ANCHOR for /.*/, not
+ for /(.|\n)/.
+
Mon Feb 8 23:53:58 1999 SHIROYAMA Takayuki <psi@fortune.nest.or.jp>
* dln.c (FUNCNAME_PATTERN): FreeBSD for alpha/mips
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index e32723be96..e937e51c2b 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -579,6 +579,7 @@ module Tk
end
module Wm
+ include TkComm
def aspect(*args)
w = window(tk_call('wm', 'grid', path, *args))
w.split.collect{|s|s.to_i} if args.length == 0
diff --git a/lib/date2.rb b/lib/date2.rb
index 50c2ccfbd9..6e87824b38 100644
--- a/lib/date2.rb
+++ b/lib/date2.rb
@@ -1,11 +1,11 @@
-# date.rb: Written by Tadayoshi Funaba 1998
-# $Id: date.rb,v 1.4 1998/06/01 12:52:33 tadf Exp $
+# date.rb: Written by Tadayoshi Funaba 1998, 1999
+# $Id: date.rb,v 1.5 1999/02/06 08:51:56 tadf Exp $
class Date
include Comparable
- MONTHNAMES = [ '', 'January', 'February', 'March', 'April', 'May', 'June',
+ MONTHNAMES = [ nil, 'January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December' ]
DAYNAMES = [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday',
@@ -162,26 +162,24 @@ class Date
end
def + (other)
- if other.kind_of? Numeric then
- return Date.new(@jd + other, @gs)
+ case other
+ when Numeric; return Date.new(@jd + other, @gs)
end
fail TypeError, 'expected numeric'
end
def - (other)
- if other.kind_of? Numeric then
- return Date.new(@jd - other, @gs)
- elsif other.kind_of? Date then
- return @jd - other.jd
+ case other
+ when Numeric; return Date.new(@jd - other, @gs)
+ when Date; return @jd - other.jd
end
fail TypeError, 'expected numeric or date'
end
def <=> (other)
- if other.kind_of? Numeric then
- return @jd <=> other
- elsif other.kind_of? Date then
- return @jd <=> other.jd
+ case other
+ when Numeric; return @jd <=> other
+ when Date; return @jd <=> other.jd
end
fail TypeError, 'expected numeric or date'
end
diff --git a/lib/weakref.rb b/lib/weakref.rb
index c31e959e74..d53aa15c71 100644
--- a/lib/weakref.rb
+++ b/lib/weakref.rb
@@ -60,10 +60,11 @@ class WeakRef<Delegator
end
if __FILE__ == $0
+ require 'thread'
foo = Object.new
- p foo.hash # original's hash value
+ p foo.to_s # original's class
foo = WeakRef.new(foo)
- p foo.hash # should be same hash value
+ p foo.to_s # should be same class
ObjectSpace.garbage_collect
- p foo.hash # should raise exception (recycled)
+ p foo.to_s # should raise exception (recycled)
end
diff --git a/regex.c b/regex.c
index 045f2a9287..5d93c47811 100644
--- a/regex.c
+++ b/regex.c
@@ -2035,7 +2035,16 @@ re_compile_pattern(pattern, size, bufp)
laststart++;
EXTRACT_NUMBER_AND_INCR(mcnt, laststart);
if (mcnt == 4 && *laststart == anychar) {
- bufp->options |= RE_OPTIMIZE_ANCHOR;
+ switch ((enum regexpcode)laststart[4]) {
+ case jump_n:
+ case finalize_jump:
+ case maybe_finalize_jump:
+ case jump:
+ case jump_past_alt:
+ case dummy_failure_jump:
+ bufp->options |= RE_OPTIMIZE_ANCHOR;
+ break;
+ }
}
else if (*laststart == charset || *laststart == charset_not) {
p0 = laststart;
@@ -3667,8 +3676,13 @@ re_match(bufp, string_arg, size, pos, regs)
because didn't fail. Also remove the register information
put on by the on_failure_jump. */
case finalize_jump:
- POP_FAILURE_POINT();
- /* Note fall through. */
+ if (stackp[-2] == d) {
+ p = stackp[-3];
+ POP_FAILURE_POINT();
+ continue;
+ }
+ POP_FAILURE_POINT();
+ /* Note fall through. */
/* Jump without taking off any failure points. */
case jump:
diff --git a/sample/cal.rb b/sample/cal.rb
index a5f4b4db18..50865dbb8f 100644
--- a/sample/cal.rb
+++ b/sample/cal.rb
@@ -1,7 +1,7 @@
#! /usr/local/bin/ruby
-# cal.rb (bsd compatible version): Written by Tadayoshi Funaba 1998
-# $Id: bsdcal.rb,v 1.2 1998/12/01 13:47:40 tadf Exp $
+# cal.rb (bsd compatible version): Written by Tadayoshi Funaba 1998, 1999
+# $Id: bsdcal.rb,v 1.3 1999/02/06 08:52:21 tadf Exp $
require 'date2'
@@ -68,7 +68,7 @@ def zip(xs)
yr
end
-while /^-(.*)$/no =~ $*[0]
+while /^-([^-].*)$/no =~ $*[0]
a = $1
if /^c(.+)?$/no =~ a then
if $1 then
@@ -90,6 +90,7 @@ while /^-(.*)$/no =~ $*[0]
end
$*.shift
end
+$*.shift if /^--/no =~ $*[0]
usage if (gs = $tab[$cc]).nil?
case $*.length
when 0
diff --git a/version.h b/version.h
index 373c3983d8..b4ab211d40 100644
--- a/version.h
+++ b/version.h
@@ -1,2 +1,2 @@
#define RUBY_VERSION "1.2.3"
-#define VERSION_DATE "99/02/09"
+#define VERSION_DATE "99/02/16"