mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
88abd791f5
* variable.c (rb_cvar_set): empty iv_tbl may cause infinite loop. * variable.c (rb_cvar_get): ditto. * variable.c (cvar_override_check): ditto. * bignum.c (rb_big_eq): convert Bignum to Float, instead of reverse. * time.c (time_localtime): getting tm should not be prohibited for frozen time objects. * time.c (time_gmtime): ditto. * version.c (Init_version): freeze RUBY_VERSION, RUBY_RELEASE_DATE, and RUBY_PLATFORM. * file.c (Init_File): freeze File::SEPARATOR, ALT_SEPARATOR and PATH_SEPARATOR. * file.c (rb_stat_cmp): should check operand type before calling get_stat(). * eval.c (rb_eval_cmd): should not invoke "call" with a block on any occasion. * numeric.c (fix_aref): idx may be a Bignum. * numeric.c (num_remainder): a bug in Numeric#remainder. * eval.c (rb_exec_end_proc): END might be called within END block. * class.c (rb_mod_clone): should not copy class name, since clone should remain anonymous. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
45 lines
1 KiB
C
45 lines
1 KiB
C
/**********************************************************************
|
|
|
|
version.c -
|
|
|
|
$Author$
|
|
$Date$
|
|
created at: Thu Sep 30 20:08:01 JST 1993
|
|
|
|
Copyright (C) 1993-2001 Yukihiro Matsumoto
|
|
|
|
**********************************************************************/
|
|
|
|
#include "ruby.h"
|
|
#include "version.h"
|
|
#include <stdio.h>
|
|
|
|
void
|
|
Init_version()
|
|
{
|
|
VALUE v = rb_obj_freeze(rb_str_new2(RUBY_VERSION));
|
|
VALUE d = rb_obj_freeze(rb_str_new2(RUBY_RELEASE_DATE));
|
|
VALUE p = rb_obj_freeze(rb_str_new2(RUBY_PLATFORM));
|
|
|
|
rb_define_global_const("RUBY_VERSION", v);
|
|
rb_define_global_const("RUBY_RELEASE_DATE", d);
|
|
rb_define_global_const("RUBY_PLATFORM", p);
|
|
|
|
/* obsolete constants */
|
|
rb_define_global_const("VERSION", v);
|
|
rb_define_global_const("RELEASE_DATE", d);
|
|
rb_define_global_const("PLATFORM", p);
|
|
}
|
|
|
|
void
|
|
ruby_show_version()
|
|
{
|
|
printf("ruby %s (%s) [%s]\n", RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM);
|
|
}
|
|
|
|
void
|
|
ruby_show_copyright()
|
|
{
|
|
printf("ruby - Copyright (C) 1993-2001 Yukihiro Matsumoto\n");
|
|
exit(0);
|
|
}
|