summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--eval.c4
-rw-r--r--ext/tk/lib/tk.rb22
-rw-r--r--regex.c22
-rw-r--r--version.h4
5 files changed, 53 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 8ef9a0be2e..b2b452c7ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -140,6 +140,11 @@ Thu May 17 05:23:52 2001 Keiju Ishitsuka <keiju@ishitsuka.com>
* lib/irb.rb lib/irb/multi-irb.rb lib/irb/ruby-lex.rb lib/irb/version.rb
resolve ctrl-c problem
+Wed May 16 01:48:34 2001 Guy Decoux <decoux@moulon.inra.fr>
+
+ * regex.c (re_compile_pattern): no back reference to a
+ subexpression if inside of it.
+
Tue May 15 17:46:37 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (rb_ary_and): should not push frozen key string.
@@ -191,6 +196,10 @@ Fri May 11 02:00:44 2001 Ryo HAYASAKA <ryoh@jaist.ac.jp>
* bignum.c (bigdivrem): access boundary bug.
+Wed May 9 14:38:33 2001 K.Kosako <kosako@sofnec.co.jp>
+
+ * eval.c (rb_yield_0): preserve and restore ruby_cref as well.
+
Tue May 8 17:12:43 2001 K.Kosako <kosako@sofnec.co.jp>
* eval.c (is_defined): core dumped during instance_eval for
diff --git a/eval.c b/eval.c
index 79e9e3e7dd..6a8cf3f552 100644
--- a/eval.c
+++ b/eval.c
@@ -3503,6 +3503,7 @@ rb_yield_0(val, self, klass, acheck)
{
NODE *node;
volatile VALUE result = Qnil;
+ volatile VALUE old_cref;
struct BLOCK *block;
struct SCOPE *old_scope;
struct FRAME frame;
@@ -3519,6 +3520,8 @@ rb_yield_0(val, self, klass, acheck)
frame = block->frame;
frame.prev = ruby_frame;
ruby_frame = &(frame);
+ old_cref = (VALUE)ruby_cref;
+ ruby_cref = (NODE*)ruby_frame->cbase;
old_scope = ruby_scope;
ruby_scope = block->scope;
ruby_block = block->prev;
@@ -3643,6 +3646,7 @@ rb_yield_0(val, self, klass, acheck)
POP_VARS();
ruby_block = block;
ruby_frame = ruby_frame->prev;
+ ruby_cref = (NODE*)old_cref;
if (ruby_scope->flag & SCOPE_DONT_RECYCLE)
scope_dup(old_scope);
ruby_scope = old_scope;
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index 262adec3f2..b1ab35598f 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -665,6 +665,10 @@ module TkPackage
include TkCore
extend TkPackage
+ def add_path(path)
+ Tk::AUTO_PATH.value = Tk::AUTO_PATH.to_a << path
+ end
+
def forget(package)
tk_call('package', 'forget', package)
nil
@@ -726,9 +730,6 @@ module Tk
TK_LIBRARY = INTERP._invoke("set", "tk_library")
LIBRARY = INTERP._invoke("info", "library")
- TCL_PACKAGE_PATH = INTERP._invoke("set", "tcl_pkgPath")
- AUTO_PATH = tk_split_simplelist(INTERP._invoke("set", "auto_path"))
-
PLATFORM = Hash[*tk_split_simplelist(INTERP._eval('array get tcl_platform'))]
JAPANIZED_TK = (INTERP._invoke("info", "commands", "kanji") != "")
@@ -1379,6 +1380,21 @@ class TkVarAccess<TkVariable
end
end
+module Tk
+ begin
+ auto_path = INTERP._invoke('set', 'auto_path')
+ rescue
+ begin
+ auto_path = INTERP._invoke('set', 'env(TCLLIBPATH)')
+ rescue
+ auto_path = Tk::LIBRARY
+ end
+ end
+ AUTO_PATH = TkVarAccess.new('auto_path', auto_path)
+
+ TCL_PACKAGE_PATH = TkVarAccess.new('tcl_pkgPath')
+end
+
module TkSelection
include Tk
extend Tk
diff --git a/regex.c b/regex.c
index d8cbfc0990..8d665471a8 100644
--- a/regex.c
+++ b/regex.c
@@ -2258,6 +2258,7 @@ re_compile_pattern(pattern, size, bufp)
if (!ISDIGIT(c)) PATUNFETCH;
if (c1 >= regnum) {
+ need_to_get_octal:
/* need to get octal */
p = p_save;
c = scan_oct(p_save, 3, &numlen) & 0xff;
@@ -2269,9 +2270,24 @@ re_compile_pattern(pattern, size, bufp)
}
/* Can't back reference to a subexpression if inside of it. */
- for (stackt = stackp - 2; stackt > stackb; stackt -= 5)
- if (*stackt == c1)
- goto normal_char;
+ for (stackt = stackp - 2; stackt > stackb; ) {
+ switch (*stackt) {
+ case '(':
+ if (stackt[-2] == c1)
+ goto need_to_get_octal;
+ stackt -= 5;
+ break;
+ case '!':
+ stackt--;
+ case '=':
+ case '>':
+ stackt -= 4;
+ break;
+ default:
+ stackt -= 3;
+ break;
+ }
+ }
laststart = b;
BUFPUSH(duplicate);
BUFPUSH(c1);
diff --git a/version.h b/version.h
index 6291a3faf3..38e7e8dd2c 100644
--- a/version.h
+++ b/version.h
@@ -1,4 +1,4 @@
#define RUBY_VERSION "1.6.4"
-#define RUBY_RELEASE_DATE "2001-05-28"
+#define RUBY_RELEASE_DATE "2001-05-29"
#define RUBY_VERSION_CODE 164
-#define RUBY_RELEASE_CODE 20010528
+#define RUBY_RELEASE_CODE 20010529