зеркало из https://github.com/github/ruby.git
2000-06-16
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
1199a7d3d6
Коммит
8d18d5b3f9
22
ChangeLog
22
ChangeLog
|
@ -1,3 +1,25 @@
|
|||
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.
|
||||
|
||||
Fri Jun 16 01:57:31 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||
|
||||
* eval.c (rb_thread_sleep_forever): pause(2) instead of sleep(3).
|
||||
|
||||
Thu Jun 15 10:46:36 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||
|
||||
* string.c (rb_str_sub_bang): should probagate taintness from
|
||||
replacement string.
|
||||
|
||||
Wed Jun 14 17:01:41 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp>
|
||||
|
||||
* rubytest.rb: add CONFIG['EXEEXT'] to the executable file name.
|
||||
|
|
19
configure.in
19
configure.in
|
@ -168,14 +168,29 @@ mingw*) LIBS="-lwsock32 -lmsvcrt $LIBS"
|
|||
ac_cv_header_sys_select_h=no
|
||||
ac_cv_header_sys_times_h=no;;
|
||||
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
|
||||
|
|
2
eval.c
2
eval.c
|
@ -7251,7 +7251,7 @@ rb_thread_sleep_forever()
|
|||
{
|
||||
if (curr_thread == curr_thread->next) {
|
||||
TRAP_BEG;
|
||||
sleep((32767L<<16)+32767);
|
||||
pause();
|
||||
TRAP_END;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -321,7 +320,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)) {
|
||||
|
@ -344,7 +343,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;
|
||||
|
||||
|
@ -365,7 +364,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;
|
||||
|
||||
|
|
|
@ -95,8 +95,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;
|
||||
|
||||
|
@ -319,7 +318,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)) {
|
||||
|
@ -339,7 +338,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;
|
||||
|
||||
|
@ -360,7 +359,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;
|
||||
|
||||
|
|
|
@ -92,8 +92,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;
|
||||
|
||||
|
@ -322,7 +321,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)) {
|
||||
|
@ -345,7 +344,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;
|
||||
|
||||
|
@ -366,7 +365,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;
|
||||
|
||||
|
|
1
io.c
1
io.c
|
@ -1799,6 +1799,7 @@ io_reopen(io, nfile)
|
|||
fptr->f = rb_fdopen(fd, mode);
|
||||
if (orig->mode & FMODE_READABLE && pos >= 0) {
|
||||
fseek(fptr->f, pos, SEEK_SET);
|
||||
fseek(orig->f, pos, SEEK_SET);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
2
re.c
2
re.c
|
@ -1355,6 +1355,7 @@ Init_Regexp()
|
|||
rb_define_singleton_method(rb_cRegexp, "compile", rb_reg_s_new, -1);
|
||||
rb_define_singleton_method(rb_cRegexp, "quote", rb_reg_s_quote, -1);
|
||||
rb_define_singleton_method(rb_cRegexp, "escape", rb_reg_s_quote, -1);
|
||||
rb_define_singleton_method(rb_cRegexp, "last_match", match_getter, 0);
|
||||
|
||||
rb_define_method(rb_cRegexp, "initialize", rb_reg_initialize_m, -1);
|
||||
rb_define_method(rb_cRegexp, "clone", rb_reg_clone, 0);
|
||||
|
@ -1367,7 +1368,6 @@ Init_Regexp()
|
|||
rb_define_method(rb_cRegexp, "source", rb_reg_source, 0);
|
||||
rb_define_method(rb_cRegexp, "casefold?", rb_reg_casefold_p, 0);
|
||||
rb_define_method(rb_cRegexp, "kcode", rb_reg_kcode_m, 0);
|
||||
rb_define_method(rb_cRegexp, "last_match", match_getter, 0);
|
||||
|
||||
rb_define_const(rb_cRegexp, "IGNORECASE", INT2FIX(RE_OPTION_IGNORECASE));
|
||||
rb_define_const(rb_cRegexp, "EXTENDED", INT2FIX(RE_OPTION_EXTENDED));
|
||||
|
|
6
string.c
6
string.c
|
@ -1087,6 +1087,7 @@ rb_str_sub_bang(argc, argv, str)
|
|||
VALUE pat, repl, match;
|
||||
struct re_registers *regs;
|
||||
int iter = 0;
|
||||
int tainted = 0;
|
||||
long plen;
|
||||
|
||||
if (argc == 1 && rb_block_given_p()) {
|
||||
|
@ -1094,6 +1095,7 @@ rb_str_sub_bang(argc, argv, str)
|
|||
}
|
||||
else if (argc == 2) {
|
||||
repl = rb_obj_as_string(argv[1]);;
|
||||
if (OBJ_TAINTED(repl)) tainted = 1;
|
||||
}
|
||||
else {
|
||||
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)", argc);
|
||||
|
@ -1113,6 +1115,7 @@ rb_str_sub_bang(argc, argv, str)
|
|||
else {
|
||||
repl = rb_reg_regsub(repl, str, regs);
|
||||
}
|
||||
if (OBJ_TAINTED(repl)) tainted = 1;
|
||||
plen = END(0) - BEG(0);
|
||||
if (RSTRING(repl)->len > plen) {
|
||||
REALLOC_N(RSTRING(str)->ptr, char,
|
||||
|
@ -1127,7 +1130,8 @@ rb_str_sub_bang(argc, argv, str)
|
|||
RSTRING(repl)->ptr, RSTRING(repl)->len);
|
||||
RSTRING(str)->len += RSTRING(repl)->len - plen;
|
||||
RSTRING(str)->ptr[RSTRING(str)->len] = '\0';
|
||||
OBJ_INFECT(str, repl);
|
||||
if (tainted) OBJ_TAINT(str);
|
||||
|
||||
return str;
|
||||
}
|
||||
return Qnil;
|
||||
|
|
16
time.c
16
time.c
|
@ -314,17 +314,22 @@ make_time_t(tptr, utc_or_local)
|
|||
if (!utc_or_local) { /* localtime zone adjust */
|
||||
#if defined(HAVE_TM_ZONE)
|
||||
tm = localtime(&guess);
|
||||
if (!tm) goto error;
|
||||
guess -= tm->tm_gmtoff;
|
||||
#else
|
||||
struct tm gt, lt;
|
||||
long tzsec;
|
||||
|
||||
t = 0;
|
||||
gt = *gmtime(&guess);
|
||||
lt = *localtime(&guess);
|
||||
tm = gmtime(&guess);
|
||||
if (!tm) goto error;
|
||||
gt = *tm;
|
||||
tm = localtime(&guess);
|
||||
if (!tm) goto error;
|
||||
lt = *tm;
|
||||
tzsec = (gt.tm_min-lt.tm_min)*60 + (gt.tm_hour-lt.tm_hour)*3600;
|
||||
|
||||
if(lt.tm_year > gt.tm_year) {
|
||||
if (lt.tm_year > gt.tm_year) {
|
||||
tzsec -= 24*3600;
|
||||
}
|
||||
else if(gt.tm_year > lt.tm_year) {
|
||||
|
@ -334,18 +339,17 @@ make_time_t(tptr, utc_or_local)
|
|||
tzsec += (gt.tm_yday - lt.tm_yday)*24*3600;
|
||||
}
|
||||
|
||||
if (lt.tm_isdst) tzsec += 3600;
|
||||
|
||||
if (lt.tm_isdst) guess += 3600;
|
||||
guess += tzsec;
|
||||
if (guess < 0) {
|
||||
goto out_of_range;
|
||||
}
|
||||
#endif
|
||||
tm = localtime(&guess);
|
||||
if (!tm) goto error;
|
||||
if (tm->tm_hour != tptr->tm_hour) {
|
||||
guess -= 3600;
|
||||
}
|
||||
#endif
|
||||
if (guess < 0) {
|
||||
goto out_of_range;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#define RUBY_VERSION "1.5.4"
|
||||
#define RUBY_RELEASE_DATE "2000-06-14"
|
||||
#define RUBY_RELEASE_DATE "2000-06-16"
|
||||
#define RUBY_VERSION_CODE 154
|
||||
#define RUBY_RELEASE_CODE 20000614
|
||||
#define RUBY_RELEASE_CODE 20000616
|
||||
|
|
Загрузка…
Ссылка в новой задаче