git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-06-13 09:42:40 +00:00
Родитель 97f8593cf8
Коммит 9ee0cafbfe
6 изменённых файлов: 69 добавлений и 18 удалений

Просмотреть файл

@ -1,3 +1,15 @@
Tue Jun 13 11:46:17 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* process.c (proc_setsid): try implement it using setpgrp() and
ioctl(fd, TIOCNOTTY, NULL).
* re.c (rb_reg_prepare_re): magic variable $= should affect regex
pattern match.
* time.c (make_time_t): use tm.tm_gmtoff if possible.
* time.c (time_zone): use tm.tm_zone if available.
Mon Jun 12 23:41:54 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
* configure.in (daylight): avoid GCC optimization.

3
ToDo
Просмотреть файл

@ -44,7 +44,8 @@ Hacking Interpreter
* scrambled script, or script filter
* setuid ruby
* performance tune for in-block (dynamic) local variables.
* generational GC ?? (is it possible?)
* generational GC ?
* give warnings to assign magic variables.
Standard Libraries

28
io.c
Просмотреть файл

@ -498,6 +498,10 @@ io_fread(ptr, len, f)
c = getc(f);
TRAP_END;
if (c == EOF) {
if (ferror(f)) {
if (errno == EINTR) continue;
rb_sys_fail(0);
}
*ptr = '\0';
break;
}
@ -624,7 +628,10 @@ rb_io_gets_internal(argc, argv, io)
c = getc(f);
TRAP_END;
if (c == EOF) {
if (ferror(f) && errno == EINTR) continue;
if (ferror(f)) {
if (errno == EINTR) continue;
rb_sys_fail(fptr->path);
}
break;
}
if ((*bp++ = c) == newline) break;
@ -711,7 +718,10 @@ rb_io_gets(io)
c = getc(f);
TRAP_END;
if (c == EOF) {
if (ferror(f) && errno == EINTR) continue;
if (ferror(f)) {
if (errno == EINTR) continue;
rb_sys_fail(fptr->path);
}
break;
}
if ((*bp++ = c) == '\n') break;
@ -865,7 +875,13 @@ rb_io_each_byte(io)
TRAP_BEG;
c = getc(f);
TRAP_END;
if (c == EOF) break;
if (c == EOF) {
if (ferror(f)) {
if (errno == EINTR) continue;
rb_sys_fail(fptr->path);
}
break;
}
rb_yield(INT2FIX(c & 0xff));
}
if (ferror(f)) rb_sys_fail(fptr->path);
@ -884,13 +900,17 @@ rb_io_getc(io)
rb_io_check_readable(fptr);
f = fptr->f;
retry:
READ_CHECK(f);
TRAP_BEG;
c = getc(f);
TRAP_END;
if (c == EOF) {
if (ferror(f)) rb_sys_fail(fptr->path);
if (ferror(f)) {
if (errno == EINTR) goto retry;
rb_sys_fail(fptr->path);
}
return Qnil;
}
return INT2FIX(c & 0xff);

Просмотреть файл

@ -826,13 +826,29 @@ proc_setpgid(obj, pid, pgrp)
static VALUE
proc_setsid()
{
#ifdef HAVE_SETSID
#if defined(HAVE_SETSID)
int pid;
rb_secure(2);
pid = setsid();
if (pid < 0) rb_sys_fail(0);
return INT2FIX(pid);
#elif defined(HAVE_SETPGRP) && defined(TIOCNOTTY)
pid_t sid;
#if defined(SETPGRP_VOID)
sid = setpgrp();
#else
sid = setpgrp(0, getpid());
#endif
if (sid == -1) return -1;
if ((fd = open("/dev/tty", O_RDWR)) >= 0) {
ioctl(fd, TIOCNOTTY, NULL);
close(fd);
}
return sid;
}
#else
rb_notimplement();
#endif
@ -1025,9 +1041,7 @@ Init_process()
#endif
#endif
#if !defined(NT)
rb_define_singleton_method(rb_mProcess, "fork", rb_f_fork, 0);
#endif
rb_define_singleton_method(rb_mProcess, "exit!", rb_f_exit_bang, -1);
rb_define_module_function(rb_mProcess, "kill", rb_f_kill, -1);
#ifndef NT

20
re.c
Просмотреть файл

@ -520,16 +520,20 @@ rb_reg_prepare_re(re)
VALUE re;
{
int need_recompile = 0;
int state;
rb_reg_check(re);
/* case-flag not set for the object */
if (!(RREGEXP(re)->ptr->options & RE_OPTION_IGNORECASE)) {
int state = FL_TEST(re, REG_CASESTATE);
if ((ruby_ignorecase || state) && !(ruby_ignorecase && state)) {
RBASIC(re)->flags ^= REG_CASESTATE;
need_recompile = 1;
}
state = FL_TEST(re, REG_CASESTATE);
/* ignorecase status */
if (ruby_ignorecase && !state) {
FL_SET(re, REG_CASESTATE);
RREGEXP(re)->ptr->options |= RE_OPTION_IGNORECASE;
need_recompile = 1;
}
if (!ruby_ignorecase && state) {
FL_UNSET(re, REG_CASESTATE);
RREGEXP(re)->ptr->options &= ~RE_OPTION_IGNORECASE;
need_recompile = 1;
}
if (!FL_TEST(re, KCODE_FIXED) &&

Просмотреть файл

@ -1,4 +1,4 @@
#define RUBY_VERSION "1.5.4"
#define RUBY_RELEASE_DATE "2000-06-12"
#define RUBY_RELEASE_DATE "2000-06-13"
#define RUBY_VERSION_CODE 154
#define RUBY_RELEASE_CODE 20000612
#define RUBY_RELEASE_CODE 20000613