From: "Cs. Henk" Date: 2005-03-01T03:15:06+09:00 Subject: Re: [PATCH] callable argument for PTY.getpty (aka PTY.spawn) --bCsyhTFzCvuiizWE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Umm, a small correction... it should be checked whether is there any argument passed... On Mon, Feb 28, 2005 at 09:09:29PM +0900, Cs. Henk wrote: > + if (rb_respond_to(*argv,rb_intern("call"))) { ^^^^ Csaba --bCsyhTFzCvuiizWE Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="pty-proc-hack.diff" diff -Naur ruby-orig/ext/pty/pty.c ruby/ext/pty/pty.c --- ruby-orig/ext/pty/pty.c 2004-12-08 06:26:27.000000000 -0700 +++ ruby/ext/pty/pty.c 2005-02-28 04:43:11.000000000 -0700 @@ -283,9 +283,14 @@ seteuid(getuid()); #endif - arg.argc = argc; - arg.argv = argv; - rb_protect(pty_exec, (VALUE)&arg, &status); + if (argc && rb_respond_to(*argv,rb_intern("call"))) { + v = *argv++; + rb_funcall2(v,rb_intern("call"),--argc,argv); + } else { + arg.argc = argc; + arg.argv = argv; + rb_protect(pty_exec, (VALUE)&arg, &status); + } sleep(1); _exit(1); } --bCsyhTFzCvuiizWE--