Skip to content

Commit

Permalink
1.4.1
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Sep 16, 1999
1 parent 1f72ff9 commit 21d0b07
Show file tree
Hide file tree
Showing 19 changed files with 397 additions and 163 deletions.
53 changes: 53 additions & 0 deletions ChangeLog
@@ -1,3 +1,56 @@
Thu Sep 16 18:40:08 1999 Yukihiro Matsumoto <matz@netlab.co.jp>

* stable version 1.4.1 released.

Thu Sep 16 11:33:22 1999 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>

* string.c (rb_str_match): should return false.

Wed Sep 15 22:46:37 1999 Yukihiro Matsumoto <matz@netlab.co.jp>

* re.c (rb_reg_s_quote): should quote `-' too.

Tue Sep 14 15:23:22 1999 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>

* parse.y (yylex): no need to ignore `\r' here.

* parse.y (nextc): strip `\r' from text.

* parse.y (nextc): support `__END__\r\n' type terminator.

Mon Sep 13 10:49:19 1999 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>

* eval.c (rb_eval): needless RTEST(ruby_verbose) removed.

Wed Sep 8 11:37:38 1999 Tadayoshi Funaba <tadf@kt.rim.or.jp>

* time.c (make_time_t): bit more strict comparison.

Tue Sep 7 00:50:56 1999 Yukihiro Matsumoto <matz@netlab.co.jp>

* range.c (range_each): use rb_str_upto() for strings.

* string.c (rb_str_upto): set upper limit by comparing curr <= end.

* range.c (range_each): should check equality to handle magic
increment.

Mon Sep 6 22:43:33 1999 Yukihiro Matsumoto <matz@netlab.co.jp>

* eval.c (rb_eval): break/next/redo available within -n/-p loop.

Fri Sep 3 11:14:31 1999 Yukihiro Matsumoto <matz@netlab.co.jp>

* compar.c (cmp_equal): should not raise exception; protect by
rb_rescue().

Thu Sep 2 05:23:05 1999 WATANABE Hirofumi <eban@os.rim.or.jp>

* file.c (rb_file_s_expand_path): use dirsep, instead of character
literal '/'.

* file.c (rb_file_s_expand_path): reduce multiple dirsep at the top.

Wed Sep 1 00:28:27 1999 Yukihiro Matsumoto <matz@netlab.co.jp>

* eval.c (rb_call): call rb_undefined() if a method appears not to
Expand Down
16 changes: 16 additions & 0 deletions MANIFEST
Expand Up @@ -88,6 +88,7 @@ lib/English.rb
lib/Env.rb
lib/README
lib/base64.rb
lib/cgi.rb
lib/cgi-lib.rb
lib/complex.rb
lib/date.rb
Expand All @@ -104,13 +105,28 @@ lib/ftools.rb
lib/getopts.rb
lib/getoptlong.rb
lib/importenv.rb
lib/irb/bind.rb
lib/irb/completion.rb
lib/irb/frame.rb
lib/irb/input-method.rb
lib/irb/loader.rb
lib/irb/main.rb
lib/irb/multi-irb.rb
lib/irb/ruby-lex.rb
lib/irb/ruby-token.rb
lib/irb/slex.rb
lib/irb/version.rb
lib/irb/xmp.rb
lib/jcode.rb
lib/mailread.rb
lib/mathn.rb
lib/matrix.rb
lib/mkmf.rb
lib/monitor.rb
lib/mutex_m.rb
lib/net/pop.rb
lib/net/session.rb
lib/net/smtp.rb
lib/observer.rb
lib/open3.rb
lib/ostruct.rb
Expand Down
26 changes: 22 additions & 4 deletions compar.c
Expand Up @@ -17,16 +17,34 @@ VALUE rb_mComparable;
static ID cmp;

static VALUE
cmp_eq(x, y)
VALUE x, y;
cmp_eq(a)
VALUE *a;
{
VALUE c = rb_funcall(x, cmp, 1, y);
VALUE c = rb_funcall(a[0], cmp, 1, a[1]);
int t = NUM2INT(c);

if (t == 0) return Qtrue;
return Qfalse;
}

static VALUE
cmp_failed()
{
return Qfalse;
}

static VALUE
cmp_equal(x, y)
VALUE x, y;
{
VALUE a[2];

if (x == y) return Qtrue;

a[0] = x; a[1] = y;
return rb_rescue(cmp_eq, (VALUE)a, cmp_failed, 0);
}

static VALUE
cmp_gt(x, y)
VALUE x, y;
Expand Down Expand Up @@ -89,7 +107,7 @@ void
Init_Comparable()
{
rb_mComparable = rb_define_module("Comparable");
rb_define_method(rb_mComparable, "==", cmp_eq, 1);
rb_define_method(rb_mComparable, "==", cmp_equal, 1);
rb_define_method(rb_mComparable, ">", cmp_gt, 1);
rb_define_method(rb_mComparable, ">=", cmp_ge, 1);
rb_define_method(rb_mComparable, "<", cmp_lt, 1);
Expand Down
34 changes: 26 additions & 8 deletions eval.c
Expand Up @@ -169,7 +169,7 @@ rb_get_method_body(klassp, idp, noexp)
struct cache_entry *ent;

if ((body = search_method(klass, id, &origin)) == 0 || !body->nd_body) {
/* store in cache */
/* store empty info in cache */
ent = cache + EXPR1(klass, id);
ent->klass = klass;
ent->origin = klass;
Expand Down Expand Up @@ -1795,11 +1795,31 @@ rb_eval(self, node)
}
break;

/* nodes for speed-up(top-level loop for -n/-p) */
/* node for speed-up(top-level loop for -n/-p) */
case NODE_OPT_N:
while (!NIL_P(rb_gets())) {
rb_eval(self, node->nd_body);
PUSH_TAG(PROT_NONE);
switch (state = EXEC_TAG()) {
case 0:
opt_n_next:
while (!NIL_P(rb_gets())) {
opt_n_redo:
rb_eval(self, node->nd_body);
}
break;

case TAG_REDO:
state = 0;
goto opt_n_redo;
case TAG_NEXT:
state = 0;
goto opt_n_next;
case TAG_BREAK:
state = 0;
default:
break;
}
POP_TAG();
if (state) JUMP_TAG(state);
RETURN(Qnil);

case NODE_SELF:
Expand Down Expand Up @@ -2371,10 +2391,8 @@ rb_eval(self, node)
/* check for static scope constants */
if (RTEST(ruby_verbose) &&
ev_const_defined((NODE*)ruby_frame->cbase, node->nd_vid)) {
if (RTEST(ruby_verbose)) {
rb_warning("already initialized constant %s",
rb_id2name(node->nd_vid));
}
rb_warn("already initialized constant %s",
rb_id2name(node->nd_vid));
}
rb_const_set(ruby_class, node->nd_vid, result);
break;
Expand Down
9 changes: 8 additions & 1 deletion file.c
Expand Up @@ -1107,7 +1107,7 @@ rb_file_s_expand_path(argc, argv)
}
}
#endif
else if (s[0] != '/') {
else if (!isdirsep(*s)) {
if (argc == 2) {
dname = rb_file_s_expand_path(1, &dname);
strcpy(buf, RSTRING(dname)->ptr);
Expand All @@ -1122,6 +1122,13 @@ rb_file_s_expand_path(argc, argv)
p = &buf[strlen(buf)];
while (p > buf && *(p - 1) == '/') p--;
}
else if (isdirsep(*s)) {
while (*s && isdirsep(*s)) {
*p++ = '/';
s++;
}
if (p > buf && *s) p--;
}
*p = '/';

for ( ; *s; s++) {
Expand Down

0 comments on commit 21d0b07

Please sign in to comment.