1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* parse.y (parse_regx): should raise error on untermitated

expression interpolation.

* pack.c (pack_unpack): should give length to utf8_to_uv().

* pack.c (utf8_to_uv): add length check.

* eval.c (rb_thread_wait_for): select may cause ERESTART on
  Solaris.

* eval.c (rb_thread_select): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2001-11-19 04:58:09 +00:00
parent 3cff13cb2c
commit fba998af1b
7 changed files with 53 additions and 40 deletions

View file

@ -3,6 +3,11 @@ Mon Nov 19 04:58:42 2001 Wakou Aoyama <wakou@fsinet.or.jp>
* lib/cgi.rb (header): support for Apache. thanks to
Shugo Maeda <shugo@ruby-lang.org>.
Mon Nov 19 01:58:14 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (parse_regx): should raise error on untermitated
expression interpolation.
Sun Nov 18 19:37:55 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* parse.y: needless conditional.
@ -10,6 +15,19 @@ Sun Nov 18 19:37:55 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* parse.y (parse_regx): parse error at unterminated regex /#{.
(ruby-bugs-ja:PR#142)
Sat Nov 17 12:37:39 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* pack.c (pack_unpack): should give length to utf8_to_uv().
* pack.c (utf8_to_uv): add length check.
Sat Nov 17 01:41:52 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_thread_wait_for): select may cause ERESTART on
Solaris.
* eval.c (rb_thread_select): ditto.
Tue Nov 13 19:50:30 2001 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in: do not override CC if set.

35
eval.c
View file

@ -7573,6 +7573,9 @@ rb_thread_schedule()
if (n < 0) {
if (rb_trap_pending) rb_trap_exec();
if (errno == EINTR) goto again;
#ifdef ERESTART
if (erestart == ERESTART) goto again;
#endif
FOREACH_THREAD_FROM(curr, th) {
if (th->wait_for & WAIT_SELECT) {
int v = 0;
@ -7730,6 +7733,9 @@ rb_thread_wait_for(time)
if (n < 0) {
switch (errno) {
case EINTR:
#ifdef ERESTART
case ERESTART:
#endif
return;
default:
rb_sys_fail("sleep");
@ -7801,14 +7807,21 @@ rb_thread_select(max, read, write, except, timeout)
TRAP_BEG;
n = select(max, read, write, except, tvp);
TRAP_END;
if (n < 0 && errno == EINTR) {
if (timeout) {
double d = timeofday() - limit;
switch (errno) {
case EINTR:
#ifdef ERESTART
case ERESTART:
#endif
if (timeout) {
double d = timeofday() - limit;
tv.tv_sec = (unsigned int)d;
tv.tv_usec = (long)((d-(double)tv.tv_sec)*1e6);
tv.tv_sec = (unsigned int)d;
tv.tv_usec = (long)((d-(double)tv.tv_sec)*1e6);
}
continue;
default:
break;
}
continue;
}
return n;
}
@ -7817,8 +7830,14 @@ rb_thread_select(max, read, write, except, timeout)
TRAP_BEG;
n = select(max, read, write, except, timeout);
TRAP_END;
if (n < 0 && errno == EINTR) {
continue;
if (n < 0) {
switch (errno) {
case EINTR:
#ifdef ERESTART
case ERESTART:
#endif
continue;
}
}
return n;
}

View file

@ -629,7 +629,7 @@ def extmake(target)
if $static_ext.size > 0 ||
!File.exist?("./Makefile") ||
older("./Makefile", "#{$top_srcdir}/ext/@setup@") ||
older("./Makefile", "../extmk.rb") ||
older("./Makefile", "#{$topdir}/ext/extmk.rb") ||
older("./Makefile", "#{$top_srcdir}/ext/#{target}/makefile.rb") ||
older("./Makefile", "#{$top_srcdir}/ext/#{target}/extconf.rb")
then

View file

@ -1563,31 +1563,6 @@ module TkXIM
end
end
module TkXIM
include Tk
extend Tk
def TkXIM.useinputmethods(window=nil,value=nil)
if window
if value
tk_call 'tk', 'useinputmethods', '-displayof', window.path, value
else
tk_call 'tk', 'useinputmethods', '-displayof', window.path
end
else
if value
tk_call 'tk', 'useinputmethods', value
else
tk_call 'tk', 'useinputmethods'
end
end
end
def useinputmethods(value=nil)
TkXIM.useinputmethods(self,value)
end
end
module TkWinfo
include Tk
extend Tk

View file

@ -691,10 +691,10 @@ class TkFont
def metrics_core_tk8x(font, window, option=nil)
if option
if window
number(tk_call('font', 'metrics', font, "-#{option}"))
else
number(tk_call('font', 'metrics', font,
"-displayof", window, "-#{option}"))
else
number(tk_call('font', 'metrics', font, "-#{option}"))
end
else
l = tk_split_list(if window

View file

@ -120,7 +120,7 @@ class PStore
ensure
@table = nil
@transaction = false
file.close
file.close if file
end
value
end

7
pack.c
View file

@ -1456,12 +1456,12 @@ pack_unpack(str, fmt)
case 'U':
if (len > send - s) len = send - s;
while (len-- > 0 && s < send) {
int alen;
while (len > 0 && s < send) {
int alen = len;
unsigned long l;
l = utf8_to_uv(s, &alen);
s += alen;
s += alen; len -= alen;
rb_ary_push(ary, rb_uint2inum(l));
}
break;
@ -1757,6 +1757,7 @@ utf8_to_uv(p, lenp)
else if (c < 0xfc) n = 5;
else if (c < 0xfe) n = 6;
else if (c == 0xfe) n = 7;
if (n > *lenp) return 0;
*lenp = n--;
uv = c;