summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-30 16:08:03 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-30 16:08:03 +0000
commit979f006b9e63cc787551d98b9bea9e94d61744de (patch)
tree8f8629ea50ad01c553bf56231af0b1f8a5d17287 /io.c
parent045eb9773e37dbe31c5ff595d380beb71ac62863 (diff)
* io.c (rb_f_syscall): type dispatch should be based on
rb_check_string_type(), not FIXNUM_P(), because values may be a bignum. [ruby-talk:72257] * eval.c (rb_call0): should pass the current klass value to block_invoke, which may be called via "super". [ruby-core:01077] * eval.c (block_invoke): now takes 4th argument "klass". * eval.c (block_alloc): should propagate BLOCK_PROC to ruby_block. * marshal.c (r_object0): should not use "yield" method, use "call" instead. (ruby-bugs-ja PR#476) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/io.c b/io.c
index 1377595050..3aceb78cbb 100644
--- a/io.c
+++ b/io.c
@@ -3446,16 +3446,16 @@ rb_f_syscall(argc, argv)
rb_raise(rb_eArgError, "too few arguments for syscall");
arg[0] = NUM2LONG(argv[0]); argv++;
while (items--) {
- if (FIXNUM_P(*argv)) {
- arg[i] = (unsigned long)NUM2LONG(*argv);
- }
- else {
- VALUE v = *argv;
+ VALUE v = rb_check_string_type(*argv);
+ if (!NIL_P(v)) {
StringValue(v);
rb_str_modify(v);
arg[i] = (unsigned long)RSTRING(v)->ptr;
}
+ else {
+ arg[i] = (unsigned long)NUM2LONG(*argv);
+ }
argv++;
i++;
}