summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-11-13 08:22:29 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-11-13 08:22:29 +0000
commite4d7dbf5a35c8e4ea0de3d50c331c0753a421b32 (patch)
tree4a78771d1a5d26d2ff798fa7670f56ef7057b76e /ext
parent4caab0e0f53d54cf55abb0430352893a1e4f29d9 (diff)
* signal.c (sighandle): should not re-register sighandler if
POSIX_SIGNAL is defined. * eval.c (error_print): errat array may be empty. * parse.y (yylex): float '1_.0' should not be allowed. * variable.c (var_getter): should care about var as Qfalse (ruby-bugs#PR199). * array.c (cmpint): <=> or block for {min,max} may return bignum. * array.c (sort_1): use rb_compint. * array.c (sort_2): ditto. * enum.c (min_ii): ditto. * enum.c (min_ii): ditto. * enum.c (max_i): ditto. * enum.c (max_ii): ditto. * mkconfig.rb: use String#dump to generate Ruby string literal. * range.c (range_eql): should override 'eql?' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/pty/pty.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 35e4080e62..765c0b4279 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -423,8 +423,8 @@ freeDevice()
/* ruby function: getpty */
static VALUE
-pty_getpty(self, shell)
- VALUE self, shell;
+pty_getpty(self, command)
+ VALUE self, command;
{
VALUE res;
struct pty_info info;
@@ -442,15 +442,19 @@ pty_getpty(self, shell)
OBJSETUP(wport, rb_cFile, T_FILE);
MakeOpenFile(wport, wfptr);
- establishShell(RSTRING(shell)->ptr,&info);
+ if (TYPE(command) == T_ARRAY)
+ command = rb_ary_join(command,rb_str_new2(" "));
+ Check_SafeStr(command);
+
+ establishShell(RSTRING(command)->ptr,&info);
rfptr->mode = rb_io_mode_flags("r");
rfptr->f = fdopen(info.fd, "r");
- rfptr->path = strdup(RSTRING(shell)->ptr);
+ rfptr->path = strdup(RSTRING(command)->ptr);
wfptr->mode = rb_io_mode_flags("w");
wfptr->f = fdopen(dup(info.fd), "w");
- wfptr->path = strdup(RSTRING(shell)->ptr);
+ wfptr->path = strdup(RSTRING(command)->ptr);
res = rb_ary_new2(2);
rb_ary_store(res,0,(VALUE)rport);
@@ -458,8 +462,7 @@ pty_getpty(self, shell)
rb_ary_store(res,2,INT2FIX(info.child_pid));
if (rb_block_given_p()) {
- rb_yield((VALUE)res);
- reset_signal_action();
+ rb_ensure(rb_yield, (VALUE)res, (VALUE (*)())reset_signal_action, Qnil);
return Qnil;
}
else {