summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-13 05:54:26 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-13 05:54:26 +0000
commita48c6de83991f0ad5c8839dae352fc09006c5c1e (patch)
tree80d282df0bf8e75a7c086b19535852b022c7323f
parentb52b4a93fde83bf35029b54526257a78595e29ec (diff)
1.2.5 pre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--eval.c42
-rw-r--r--ext/Setup2
-rw-r--r--ext/extmk.rb.in2
-rw-r--r--io.c1
-rw-r--r--parse.y5
-rw-r--r--regex.c4
-rw-r--r--version.h4
8 files changed, 40 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 3cc4dd5b07..e574630d76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Apr 12 23:12:32 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * io.c (rb_io_reopen): check for reopening same IO.
+
Thu Apr 8 18:10:37 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* version 1.2.4 (stable) released.
diff --git a/eval.c b/eval.c
index 56be8c72d4..59b9244008 100644
--- a/eval.c
+++ b/eval.c
@@ -497,14 +497,16 @@ dyna_var_push(id, value)
the_dyna_vars = new_dvar(id, value);
}
-VALUE
-dyna_var_asgn(id, value)
+static VALUE
+dvar_asgn(id, value, push)
ID id;
VALUE value;
+ int push;
{
struct RVarmap *vars = the_dyna_vars;
while (vars) {
+ if (push && vars->id == 0) break;
if (vars->id == id) {
vars->val = value;
return value;
@@ -515,19 +517,29 @@ dyna_var_asgn(id, value)
return value;
}
+VALUE
+dyna_var_asgn(id, value)
+ ID id;
+ VALUE value;
+{
+ return dvar_asgn(id, value, 0);
+}
+
static void
dvar_asgn_push(id, value)
ID id;
VALUE value;
{
- if (the_dyna_vars && the_dyna_vars->id == 0) {
- struct RVarmap* vars = new_dvar(id, value);
+ struct RVarmap* vars = 0;
- vars->next = the_dyna_vars->next;
- the_dyna_vars->next = vars;
+ if (the_dyna_vars && the_dyna_vars->id == 0) {
+ vars = the_dyna_vars;
+ the_dyna_vars = the_dyna_vars->next;
}
- else {
- dyna_var_asgn(id, value);
+ dvar_asgn(id, value, 1);
+ if (vars) {
+ vars->next = the_dyna_vars;
+ the_dyna_vars = vars;
}
}
@@ -636,7 +648,7 @@ VALUE the_class;
static VALUE rb_eval _((VALUE,NODE*));
static VALUE eval _((VALUE,VALUE,VALUE,char*,int));
-static NODE *compile _((VALUE,char*));
+static NODE *compile _((VALUE));
static VALUE rb_call _((VALUE,VALUE,ID,int,VALUE*,int));
static VALUE module_setup _((VALUE,NODE*));
@@ -2340,7 +2352,7 @@ rb_eval(self, node)
case NODE_EVSTR:
sourceline = nd_line(node);
rb_in_eval++;
- list->nd_head = compile(list->nd_head->nd_lit,0);
+ list->nd_head = compile(list->nd_head->nd_lit);
eval_tree = 0;
rb_in_eval--;
if (nerrs > 0) {
@@ -3851,15 +3863,13 @@ rb_frame_last_func()
}
static NODE*
-compile(src, place)
+compile(src)
VALUE src;
- char *place;
{
NODE *node;
Check_Type(src, T_STRING);
- if (place == 0) place = sourcefile;
- node = compile_string(place, RSTRING(src)->ptr, RSTRING(src)->len);
+ node = compile_string(sourcefile, RSTRING(src)->ptr, RSTRING(src)->len);
if (nerrs == 0) return node;
return 0;
@@ -3927,7 +3937,7 @@ eval(self, src, scope, file, line)
if ((state = EXEC_TAG()) == 0) {
sourcefile = file;
sourceline = line;
- compile(src, file);
+ compile(src);
if (nerrs > 0) {
compile_error(0);
}
@@ -3984,7 +3994,7 @@ f_eval(argc, argv, self)
{
VALUE src, scope, vfile, vline;
char *file = "(eval)";
- int line = 0;
+ int line = 1;
rb_scan_args(argc, argv, "13", &src, &scope, &vfile, &vline);
if (argc >= 3) {
diff --git a/ext/Setup b/ext/Setup
index 9e3a2474c3..b6917e5d32 100644
--- a/ext/Setup
+++ b/ext/Setup
@@ -7,7 +7,7 @@
#fcntl
#kconv
#md5
-#socket
+socket
#tkutil
#tcltklib
#gtk
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index 2eb6cadf2c..15380b43cd 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -552,7 +552,7 @@ if $extlist.size > 0
if PLATFORM =~ /m68k-human|beos/
$extlibs.gsub!("-L/usr/local/lib", "") if $extlibs
end
- system format('make #{ruby} EXTOBJS="%s" EXTLIBS="%s"', $extobjs, $extlibs)
+ system format("make #{ruby} EXTOBJS='%s' EXTLIBS='%s'", $extobjs, $extlibs)
else
Dir.chdir ".."
if older(ruby, miniruby)
diff --git a/io.c b/io.c
index 3e0ff9e90b..bfe07df80c 100644
--- a/io.c
+++ b/io.c
@@ -1344,6 +1344,7 @@ io_reopen(io, nfile)
nfile = io_get_io(nfile);
GetOpenFile(nfile, orig);
+ if (fptr == orig) return io;
if (orig->f2) {
fflush(orig->f2);
}
diff --git a/parse.y b/parse.y
index 091c6c52e0..ffcc791fe5 100644
--- a/parse.y
+++ b/parse.y
@@ -1677,10 +1677,9 @@ compile_string(f, s, len)
lex_pbeg = lex_p = s;
lex_pend = s + len;
lex_input = 0;
- if (!sourcefile || strcmp(f, sourcefile)) /* not in eval() */
+ if (!sourcefile || strcmp(f, sourcefile))
sourceline = 1;
- else /* in eval() */
- compile_for_eval = 1;
+ compile_for_eval = 1;
return yycompile(f);
}
diff --git a/regex.c b/regex.c
index 50bcd6a6d1..a1aeb2ec6f 100644
--- a/regex.c
+++ b/regex.c
@@ -3899,8 +3899,10 @@ re_match(bufp, string_arg, size, pos, regs)
SET_REGS_MATCHED;
break;
}
+#if 0
while (stackp != stackb && (int)stackp[-1] == 1)
POP_FAILURE_POINT();
+#endif
continue; /* Successfully executed one pattern command; keep going. */
/* Jump here if any matching operation fails. */
@@ -3912,7 +3914,7 @@ re_match(bufp, string_arg, size, pos, regs)
/* If this failure point is from a dummy_failure_point, just
skip it. */
- if (stackp[-3] == 0) {
+ if (stackp[-3] == 0 || (best_regs_set && (int)stackp[-1] == 1)) {
POP_FAILURE_POINT();
goto fail;
}
diff --git a/version.h b/version.h
index 69f06e07eb..ed675880de 100644
--- a/version.h
+++ b/version.h
@@ -1,2 +1,2 @@
-#define RUBY_VERSION "1.2.4"
-#define VERSION_DATE "99/04/08"
+#define RUBY_VERSION "1.2.5"
+#define VERSION_DATE "99/04/13"