mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
2000-06-20
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
dc9d02aa1d
commit
79a5d02e19
12 changed files with 395 additions and 309 deletions
33
ChangeLog
33
ChangeLog
|
@ -1,9 +1,42 @@
|
|||
Tue Jun 20 15:07:39 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||
|
||||
* lib/parsedate.rb: don't seek year too greedy.
|
||||
|
||||
Tue Jun 20 06:14:43 2000 Wakou Aoyama <wakou@fsinet.or.jp>
|
||||
|
||||
* lib/cgi.rb: change: version syntax. old: x.yz, now: x.y.z
|
||||
|
||||
* lib/net/telnet.rb: ditto.
|
||||
|
||||
Fri Jun 16 05:18:45 2000 Yasuhiro Fukuma <yasuf@bsdclub.org>
|
||||
|
||||
* configure.in: FreeBSD: do not link dummy libxpg4 which was
|
||||
merged into libc.
|
||||
|
||||
Fri Jun 16 03:17:36 2000 Satoshi Nojo <nojo@t-samukawa.or.jp>
|
||||
|
||||
* ext/dbm/dbm.c (fdbm_length): use GetDBM. empty?, [] too.
|
||||
|
||||
* ext/gdbm/gdbm.c (fgdbm_length): ditto.
|
||||
|
||||
* ext/sdbm/init.c (fsdbm_length): ditto.
|
||||
|
||||
Wed Jun 14 17:01:41 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp>
|
||||
|
||||
* rubytest.rb: add CONFIG['EXEEXT'] to the executable file name.
|
||||
|
||||
Wed Jun 14 14:50:00 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||
|
||||
* eval.c (method_arity): wrong arity number for the methods with
|
||||
optional arguments.
|
||||
|
||||
* time.c (make_time_t): opposite timezone shift (should be negative).
|
||||
|
||||
Wed 14 Jun 04:58:53 2000 Dave Thomas <dave@thomases.com>
|
||||
|
||||
* io.c (rb_io_set_lineno): should have returned VALUE, not
|
||||
integer.
|
||||
|
||||
Wed Jun 14 13:17:02 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
|
||||
|
||||
* io.c: typo(ig/if).
|
||||
|
|
19
configure.in
19
configure.in
|
@ -144,14 +144,29 @@ human*) ac_cv_func_getpgrp_void=yes;;
|
|||
beos*) ;;
|
||||
cygwin*) ;;
|
||||
os2_emx*) LIBS="-lm $LIBS"
|
||||
ac_cv_lib_xpg4_setlocale=no
|
||||
ac_cv_lib_dir_opendir=no;;
|
||||
freebsd*) LIBS="-lm $LIBS"
|
||||
AC_CACHE_CHECK([whether -lxpg4 has to be linked],
|
||||
rb_cv_lib_xpg4_needed,
|
||||
[AC_TRY_CPP([
|
||||
#include <osreldate.h>
|
||||
#if __FreeBSD_version < 400020 || \
|
||||
(__FreeBSD_version >= 500000 && __FreeBSD_version < 500005)
|
||||
#error needs libxpg4
|
||||
#endif
|
||||
],
|
||||
rb_cv_lib_xpg4_needed=no,
|
||||
rb_cv_lib_xpg4_needed=yes,
|
||||
rb_cv_lib_xpg4_needed=yes)])
|
||||
if test "$rb_cv_lib_xpg4_needed" = yes; then
|
||||
AC_CHECK_LIB(xpg4, setlocale)
|
||||
fi
|
||||
;;
|
||||
*) LIBS="-lm $LIBS";;
|
||||
esac
|
||||
AC_CHECK_LIB(crypt, crypt)
|
||||
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
|
||||
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
|
||||
AC_CHECK_LIB(xpg4, setlocale) # FreeBSD needs this
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_DIRENT
|
||||
|
|
81
eval.c
81
eval.c
|
@ -5981,7 +5981,8 @@ method_arity(method)
|
|||
body = body->nd_head;
|
||||
if (!body) return INT2FIX(0);
|
||||
n = body->nd_cnt;
|
||||
if (body->nd_rest >= 0) n = -n-1;
|
||||
if (body->nd_opt || body->nd_rest >= 0)
|
||||
n = -n-1;
|
||||
return INT2FIX(n);
|
||||
}
|
||||
}
|
||||
|
@ -6114,7 +6115,7 @@ enum thread_status {
|
|||
/* +infty, for this purpose */
|
||||
#define DELAY_INFTY 1E30
|
||||
|
||||
typedef struct thread * thread_t;
|
||||
typedef struct thread * rb_thread_t;
|
||||
|
||||
struct thread {
|
||||
struct thread *next, *prev;
|
||||
|
@ -6152,7 +6153,7 @@ struct thread {
|
|||
int wait_for;
|
||||
int fd;
|
||||
double delay;
|
||||
thread_t join;
|
||||
rb_thread_t join;
|
||||
|
||||
int abort;
|
||||
|
||||
|
@ -6163,8 +6164,8 @@ struct thread {
|
|||
|
||||
#define THREAD_RAISED 0x200
|
||||
|
||||
static thread_t main_thread;
|
||||
static thread_t curr_thread = 0;
|
||||
static rb_thread_t main_thread;
|
||||
static rb_thread_t curr_thread = 0;
|
||||
|
||||
static int num_waiting_on_fd = 0;
|
||||
static int num_waiting_on_timer = 0;
|
||||
|
@ -6190,7 +6191,7 @@ timeofday()
|
|||
|
||||
static void
|
||||
thread_mark(th)
|
||||
thread_t th;
|
||||
rb_thread_t th;
|
||||
{
|
||||
struct FRAME *frame;
|
||||
struct BLOCK *block;
|
||||
|
@ -6245,7 +6246,7 @@ thread_mark(th)
|
|||
void
|
||||
rb_gc_mark_threads()
|
||||
{
|
||||
thread_t th;
|
||||
rb_thread_t th;
|
||||
|
||||
if (!curr_thread) return;
|
||||
FOREACH_THREAD(th) {
|
||||
|
@ -6255,7 +6256,7 @@ rb_gc_mark_threads()
|
|||
|
||||
static void
|
||||
thread_free(th)
|
||||
thread_t th;
|
||||
rb_thread_t th;
|
||||
{
|
||||
if (th->stk_ptr) free(th->stk_ptr);
|
||||
th->stk_ptr = 0;
|
||||
|
@ -6267,7 +6268,7 @@ thread_free(th)
|
|||
if (th != main_thread) free(th);
|
||||
}
|
||||
|
||||
static thread_t
|
||||
static rb_thread_t
|
||||
rb_thread_check(data)
|
||||
VALUE data;
|
||||
{
|
||||
|
@ -6275,7 +6276,7 @@ rb_thread_check(data)
|
|||
rb_raise(rb_eTypeError, "wrong argument type %s (expected Thread)",
|
||||
rb_class2name(CLASS_OF(data)));
|
||||
}
|
||||
return (thread_t)RDATA(data)->data;
|
||||
return (rb_thread_t)RDATA(data)->data;
|
||||
}
|
||||
|
||||
static int th_raise_argc;
|
||||
|
@ -6295,7 +6296,7 @@ static char *th_signm;
|
|||
|
||||
static void
|
||||
rb_thread_save_context(th)
|
||||
thread_t th;
|
||||
rb_thread_t th;
|
||||
{
|
||||
VALUE v;
|
||||
|
||||
|
@ -6365,11 +6366,11 @@ thread_switch(n)
|
|||
#define THREAD_SAVE_CONTEXT(th) \
|
||||
(rb_thread_save_context(th),thread_switch(setjmp((th)->context)))
|
||||
|
||||
static void rb_thread_restore_context _((thread_t,int));
|
||||
static void rb_thread_restore_context _((rb_thread_t,int));
|
||||
|
||||
static void
|
||||
stack_extend(th, exit)
|
||||
thread_t th;
|
||||
rb_thread_t th;
|
||||
int exit;
|
||||
{
|
||||
VALUE space[1024];
|
||||
|
@ -6380,11 +6381,11 @@ stack_extend(th, exit)
|
|||
|
||||
static void
|
||||
rb_thread_restore_context(th, exit)
|
||||
thread_t th;
|
||||
rb_thread_t th;
|
||||
int exit;
|
||||
{
|
||||
VALUE v;
|
||||
static thread_t tmp;
|
||||
static rb_thread_t tmp;
|
||||
static int ex;
|
||||
|
||||
if (!th->stk_ptr) rb_bug("unsaved context");
|
||||
|
@ -6428,7 +6429,7 @@ rb_thread_restore_context(th, exit)
|
|||
|
||||
static void
|
||||
rb_thread_ready(th)
|
||||
thread_t th;
|
||||
rb_thread_t th;
|
||||
{
|
||||
/* The thread is no longer waiting on anything */
|
||||
if (th->wait_for & WAIT_FD) {
|
||||
|
@ -6455,7 +6456,7 @@ rb_thread_remove()
|
|||
|
||||
static int
|
||||
rb_thread_dead(th)
|
||||
thread_t th;
|
||||
rb_thread_t th;
|
||||
{
|
||||
return th->status == THREAD_KILLED;
|
||||
}
|
||||
|
@ -6464,7 +6465,7 @@ void
|
|||
rb_thread_fd_close(fd)
|
||||
int fd;
|
||||
{
|
||||
thread_t th;
|
||||
rb_thread_t th;
|
||||
|
||||
FOREACH_THREAD(th) {
|
||||
if ((th->wait_for & WAIT_FD) && th->fd == fd) {
|
||||
|
@ -6505,9 +6506,9 @@ rb_thread_deadlock()
|
|||
void
|
||||
rb_thread_schedule()
|
||||
{
|
||||
thread_t next; /* OK */
|
||||
thread_t th;
|
||||
thread_t curr;
|
||||
rb_thread_t next; /* OK */
|
||||
rb_thread_t th;
|
||||
rb_thread_t curr;
|
||||
|
||||
select_err:
|
||||
rb_thread_pending = 0;
|
||||
|
@ -6841,7 +6842,7 @@ static VALUE
|
|||
rb_thread_join(thread)
|
||||
VALUE thread;
|
||||
{
|
||||
thread_t th = rb_thread_check(thread);
|
||||
rb_thread_t th = rb_thread_check(thread);
|
||||
|
||||
if (!rb_thread_dead(th)) {
|
||||
if (th == curr_thread)
|
||||
|
@ -6894,7 +6895,7 @@ VALUE
|
|||
rb_thread_wakeup(thread)
|
||||
VALUE thread;
|
||||
{
|
||||
thread_t th = rb_thread_check(thread);
|
||||
rb_thread_t th = rb_thread_check(thread);
|
||||
|
||||
if (th->status == THREAD_KILLED)
|
||||
rb_raise(rb_eThreadError, "killed thread");
|
||||
|
@ -6917,7 +6918,7 @@ static VALUE
|
|||
rb_thread_kill(thread)
|
||||
VALUE thread;
|
||||
{
|
||||
thread_t th = rb_thread_check(thread);
|
||||
rb_thread_t th = rb_thread_check(thread);
|
||||
|
||||
if (th->status == THREAD_TO_KILL || th->status == THREAD_KILLED)
|
||||
return thread;
|
||||
|
@ -7014,7 +7015,7 @@ static VALUE
|
|||
rb_thread_abort_exc(thread)
|
||||
VALUE thread;
|
||||
{
|
||||
thread_t th = rb_thread_check(thread);
|
||||
rb_thread_t th = rb_thread_check(thread);
|
||||
|
||||
return th->abort?Qtrue:Qfalse;
|
||||
}
|
||||
|
@ -7023,7 +7024,7 @@ static VALUE
|
|||
rb_thread_abort_exc_set(thread, val)
|
||||
VALUE thread, val;
|
||||
{
|
||||
thread_t th = rb_thread_check(thread);
|
||||
rb_thread_t th = rb_thread_check(thread);
|
||||
|
||||
th->abort = RTEST(val);
|
||||
return val;
|
||||
|
@ -7060,11 +7061,11 @@ rb_thread_abort_exc_set(thread, val)
|
|||
th->locals = 0;\
|
||||
} while(0)
|
||||
|
||||
static thread_t
|
||||
static rb_thread_t
|
||||
rb_thread_alloc(klass)
|
||||
VALUE klass;
|
||||
{
|
||||
thread_t th;
|
||||
rb_thread_t th;
|
||||
|
||||
THREAD_ALLOC(th);
|
||||
th->thread = Data_Wrap_Struct(klass, thread_mark, thread_free, th);
|
||||
|
@ -7140,7 +7141,7 @@ rb_thread_create_0(fn, arg, klass)
|
|||
void *arg;
|
||||
VALUE klass;
|
||||
{
|
||||
thread_t th = rb_thread_alloc(klass);
|
||||
rb_thread_t th = rb_thread_alloc(klass);
|
||||
volatile VALUE thread = th->thread;
|
||||
enum thread_status status;
|
||||
int state;
|
||||
|
@ -7215,7 +7216,7 @@ rb_thread_scope_shared_p()
|
|||
static VALUE
|
||||
rb_thread_yield(arg, th)
|
||||
int arg;
|
||||
thread_t th;
|
||||
rb_thread_t th;
|
||||
{
|
||||
scope_dup(ruby_block->scope);
|
||||
return rb_yield_0(th->thread, 0, 0, Qfalse);
|
||||
|
@ -7235,7 +7236,7 @@ static VALUE
|
|||
rb_thread_value(thread)
|
||||
VALUE thread;
|
||||
{
|
||||
thread_t th = rb_thread_check(thread);
|
||||
rb_thread_t th = rb_thread_check(thread);
|
||||
|
||||
rb_thread_join(thread);
|
||||
|
||||
|
@ -7246,7 +7247,7 @@ static VALUE
|
|||
rb_thread_status(thread)
|
||||
VALUE thread;
|
||||
{
|
||||
thread_t th = rb_thread_check(thread);
|
||||
rb_thread_t th = rb_thread_check(thread);
|
||||
|
||||
if (rb_thread_dead(th)) {
|
||||
if (NIL_P(th->errinfo) && (th->flags & THREAD_RAISED))
|
||||
|
@ -7261,7 +7262,7 @@ static VALUE
|
|||
rb_thread_stop_p(thread)
|
||||
VALUE thread;
|
||||
{
|
||||
thread_t th = rb_thread_check(thread);
|
||||
rb_thread_t th = rb_thread_check(thread);
|
||||
|
||||
if (rb_thread_dead(th)) return Qtrue;
|
||||
if (th->status == THREAD_STOPPED) return Qtrue;
|
||||
|
@ -7280,7 +7281,7 @@ rb_thread_wait_other_threads()
|
|||
static void
|
||||
rb_thread_cleanup()
|
||||
{
|
||||
thread_t th;
|
||||
rb_thread_t th;
|
||||
|
||||
if (curr_thread != curr_thread->next->prev) {
|
||||
curr_thread = curr_thread->prev;
|
||||
|
@ -7372,7 +7373,7 @@ rb_thread_raise(argc, argv, thread)
|
|||
VALUE *argv;
|
||||
VALUE thread;
|
||||
{
|
||||
thread_t th = rb_thread_check(thread);
|
||||
rb_thread_t th = rb_thread_check(thread);
|
||||
|
||||
if (rb_thread_dead(th)) return thread;
|
||||
if (curr_thread == th) {
|
||||
|
@ -7430,7 +7431,7 @@ rb_thread_local_aref(thread, id)
|
|||
VALUE thread;
|
||||
ID id;
|
||||
{
|
||||
thread_t th;
|
||||
rb_thread_t th;
|
||||
VALUE val;
|
||||
|
||||
th = rb_thread_check(thread);
|
||||
|
@ -7454,7 +7455,7 @@ rb_thread_local_aset(thread, id, val)
|
|||
ID id;
|
||||
VALUE val;
|
||||
{
|
||||
thread_t th = rb_thread_check(thread);
|
||||
rb_thread_t th = rb_thread_check(thread);
|
||||
|
||||
if (safe_level >= 4 && !FL_TEST(thread, FL_TAINT))
|
||||
rb_raise(rb_eSecurityError, "Insecure: can't modify thread values");
|
||||
|
@ -7482,7 +7483,7 @@ static VALUE
|
|||
rb_thread_key_p(thread, id)
|
||||
VALUE thread, id;
|
||||
{
|
||||
thread_t th = rb_thread_check(thread);
|
||||
rb_thread_t th = rb_thread_check(thread);
|
||||
|
||||
if (!th->locals) return Qfalse;
|
||||
if (st_lookup(th->locals, rb_to_id(id), 0))
|
||||
|
@ -7497,7 +7498,7 @@ rb_callcc(self)
|
|||
VALUE self;
|
||||
{
|
||||
volatile VALUE cont;
|
||||
thread_t th;
|
||||
rb_thread_t th;
|
||||
struct tag *tag;
|
||||
|
||||
THREAD_ALLOC(th);
|
||||
|
@ -7523,7 +7524,7 @@ rb_continuation_call(argc, argv, cont)
|
|||
VALUE *argv;
|
||||
VALUE cont;
|
||||
{
|
||||
thread_t th = rb_thread_check(cont);
|
||||
rb_thread_t th = rb_thread_check(cont);
|
||||
|
||||
switch (argc) {
|
||||
case 0:
|
||||
|
|
|
@ -98,8 +98,7 @@ fdbm_close(obj)
|
|||
{
|
||||
struct dbmdata *dbmp;
|
||||
|
||||
Data_Get_Struct(obj, struct dbmdata, dbmp);
|
||||
if (dbmp->di_dbm == 0) closed_dbm();
|
||||
GetDBM(obj, dbmp);
|
||||
dbm_close(dbmp->di_dbm);
|
||||
dbmp->di_dbm = 0;
|
||||
|
||||
|
@ -328,7 +327,7 @@ fdbm_store(obj, keystr, valstr)
|
|||
val.dptr = RSTRING(valstr)->ptr;
|
||||
val.dsize = RSTRING(valstr)->len;
|
||||
|
||||
Data_Get_Struct(obj, struct dbmdata, dbmp);
|
||||
GetDBM(obj, dbmp);
|
||||
dbmp->di_size = -1;
|
||||
dbm = dbmp->di_dbm;
|
||||
if (dbm_store(dbm, key, val, DBM_REPLACE)) {
|
||||
|
@ -351,7 +350,7 @@ fdbm_length(obj)
|
|||
DBM *dbm;
|
||||
int i = 0;
|
||||
|
||||
Data_Get_Struct(obj, struct dbmdata, dbmp);
|
||||
GetDBM(obj, dbmp);
|
||||
if (dbmp->di_size > 0) return INT2FIX(dbmp->di_size);
|
||||
dbm = dbmp->di_dbm;
|
||||
|
||||
|
@ -372,7 +371,7 @@ fdbm_empty_p(obj)
|
|||
DBM *dbm;
|
||||
int i = 0;
|
||||
|
||||
Data_Get_Struct(obj, struct dbmdata, dbmp);
|
||||
GetDBM(obj, dbmp);
|
||||
if (dbmp->di_size < 0) {
|
||||
dbm = dbmp->di_dbm;
|
||||
|
||||
|
|
|
@ -99,8 +99,7 @@ fgdbm_close(obj)
|
|||
{
|
||||
struct dbmdata *dbmp;
|
||||
|
||||
Data_Get_Struct(obj, struct dbmdata, dbmp);
|
||||
if (dbmp->di_dbm == 0) closed_dbm();
|
||||
GetDBM(obj, dbmp);
|
||||
gdbm_close(dbmp->di_dbm);
|
||||
dbmp->di_dbm = 0;
|
||||
|
||||
|
@ -330,7 +329,7 @@ fgdbm_store(obj, keystr, valstr)
|
|||
val.dptr = RSTRING(valstr)->ptr;
|
||||
val.dsize = RSTRING(valstr)->len;
|
||||
|
||||
Data_Get_Struct(obj, struct dbmdata, dbmp);
|
||||
GetDBM(obj, dbmp);
|
||||
dbmp->di_size = -1;
|
||||
dbm = dbmp->di_dbm;
|
||||
if (gdbm_store(dbm, key, val, GDBM_REPLACE)) {
|
||||
|
@ -350,7 +349,7 @@ fgdbm_length(obj)
|
|||
GDBM_FILE dbm;
|
||||
int i = 0;
|
||||
|
||||
Data_Get_Struct(obj, struct dbmdata, dbmp);
|
||||
GetDBM(obj, dbmp);
|
||||
if (dbmp->di_size > 0) return INT2FIX(dbmp->di_size);
|
||||
dbm = dbmp->di_dbm;
|
||||
|
||||
|
@ -371,7 +370,7 @@ fgdbm_empty_p(obj)
|
|||
GDBM_FILE dbm;
|
||||
int i = 0;
|
||||
|
||||
Data_Get_Struct(obj, struct dbmdata, dbmp);
|
||||
GetDBM(obj, dbmp);
|
||||
if (dbmp->di_size < 0) {
|
||||
dbm = dbmp->di_dbm;
|
||||
|
||||
|
|
|
@ -95,8 +95,7 @@ fsdbm_close(obj)
|
|||
{
|
||||
struct dbmdata *dbmp;
|
||||
|
||||
Data_Get_Struct(obj, struct dbmdata, dbmp);
|
||||
if (dbmp->di_dbm == 0) closed_sdbm();
|
||||
GetDBM(obj, dbmp);
|
||||
sdbm_close(dbmp->di_dbm);
|
||||
dbmp->di_dbm = 0;
|
||||
|
||||
|
@ -325,7 +324,7 @@ fsdbm_store(obj, keystr, valstr)
|
|||
val.dptr = RSTRING(valstr)->ptr;
|
||||
val.dsize = RSTRING(valstr)->len;
|
||||
|
||||
Data_Get_Struct(obj, struct dbmdata, dbmp);
|
||||
GetDBM(obj, dbmp);
|
||||
dbmp->di_size = -1;
|
||||
dbm = dbmp->di_dbm;
|
||||
if (sdbm_store(dbm, key, val, DBM_REPLACE)) {
|
||||
|
@ -348,7 +347,7 @@ fsdbm_length(obj)
|
|||
DBM *dbm;
|
||||
int i = 0;
|
||||
|
||||
Data_Get_Struct(obj, struct dbmdata, dbmp);
|
||||
GetDBM(obj, dbmp);
|
||||
if (dbmp->di_size > 0) return INT2FIX(dbmp->di_size);
|
||||
dbm = dbmp->di_dbm;
|
||||
|
||||
|
@ -369,7 +368,7 @@ fsdbm_empty_p(obj)
|
|||
DBM *dbm;
|
||||
int i = 0;
|
||||
|
||||
Data_Get_Struct(obj, struct dbmdata, dbmp);
|
||||
GetDBM(obj, dbmp);
|
||||
if (dbmp->di_size < 0) {
|
||||
dbm = dbmp->di_dbm;
|
||||
|
||||
|
|
3
io.c
3
io.c
|
@ -741,7 +741,8 @@ rb_io_set_lineno(io, lineno)
|
|||
|
||||
GetOpenFile(io, fptr);
|
||||
rb_io_check_readable(fptr);
|
||||
return fptr->lineno = NUM2INT(lineno);
|
||||
fptr->lineno = NUM2INT(lineno);
|
||||
return lineno;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -67,9 +67,9 @@ module ParseDate
|
|||
mon = MONTHS[$2.downcase]
|
||||
year = $3.to_i
|
||||
end
|
||||
if date.sub!(/\d{4}/i, ' ')
|
||||
if !year && date.sub!(/\d{4}/i, ' ')
|
||||
year = $&.to_i
|
||||
elsif date.sub!(/\d\d/i, ' ')
|
||||
elsif !year && date.sub!(/\d\d/i, ' ')
|
||||
year = $&.to_i
|
||||
end
|
||||
if guess and year
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rbconfig'
|
||||
include Config
|
||||
|
||||
unless File.exist? "./#{CONFIG['ruby_install_name']}"
|
||||
unless File.exist? "./#{CONFIG['ruby_install_name']}#{CONFIG['EXEEXT']}"
|
||||
print "./#{CONFIG['ruby_install_name']} is not found.\n"
|
||||
print "Try `make' first, then `make test', please.\n"
|
||||
exit 0
|
||||
|
|
17
time.c
17
time.c
|
@ -292,19 +292,16 @@ make_time_t(tptr, utc_or_local)
|
|||
if (!tm) goto error;
|
||||
if (tptr->tm_year != tm->tm_year) goto out_of_range;
|
||||
}
|
||||
guess += (tptr->tm_mday - tm->tm_mday) * 3600 * 24;
|
||||
guess += (tptr->tm_mday - tm->tm_mday) * 24 * 3600;
|
||||
guess += (tptr->tm_hour - tm->tm_hour) * 3600;
|
||||
guess += (tptr->tm_min - tm->tm_min) * 60;
|
||||
guess += (tptr->tm_sec - tm->tm_sec);
|
||||
if (guess < 0) goto out_of_range;
|
||||
|
||||
if (!utc_or_local) { /* localtime zone adjust */
|
||||
#if defined(HAVE_DAYLIGHT)
|
||||
extern int daylight;
|
||||
extern long timezone;
|
||||
|
||||
localtime(&guess);
|
||||
guess += timezone + daylight;
|
||||
#if defined(HAVE_TM_ZONE)
|
||||
tm = localtime(&guess);
|
||||
guess -= tm->tm_gmtoff;
|
||||
#else
|
||||
struct tm gt, lt;
|
||||
long tzsec;
|
||||
|
@ -799,8 +796,14 @@ time_zone(time)
|
|||
time_get_tm(time, tobj->gmt);
|
||||
}
|
||||
|
||||
#if defined(HAVE_TM_ZONE)
|
||||
return rb_str_new2(tobj->tm.tm_zone);
|
||||
#elif defined(HAVE_TZNAME) && defined(HAVE_DAYLIGHT)
|
||||
return rb_str_new2(tzname[daylight && tobj->tm.tm_isdst]);
|
||||
#else
|
||||
len = strftime(buf, 64, "%Z", &tobj->tm);
|
||||
return rb_str_new(buf, len);
|
||||
#endif
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#define RUBY_VERSION "1.4.4"
|
||||
#define RUBY_RELEASE_DATE "2000-06-14"
|
||||
#define RUBY_VERSION_CODE 144
|
||||
#define RUBY_RELEASE_CODE 20000614
|
||||
#define RUBY_VERSION "1.4.5"
|
||||
#define RUBY_RELEASE_DATE "2000-06-20"
|
||||
#define RUBY_VERSION_CODE 145
|
||||
#define RUBY_RELEASE_CODE 20000620
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue