ruby-changes:28031
From: akr <ko1@a...>
Date: Wed, 3 Apr 2013 20:55:28 +0900 (JST)
Subject: [ruby-changes:28031] akr:r40083 (trunk): * process.c: Describe the behavior which Ruby invokes a commandline
akr 2013-04-03 20:55:18 +0900 (Wed, 03 Apr 2013) New Revision: 40083 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40083 Log: * process.c: Describe the behavior which Ruby invokes a commandline directly without shell if the commandline is simple enough. [ruby-core:50459] [Bug #7489] Modified files: trunk/ChangeLog trunk/process.c Index: ChangeLog =================================================================== --- ChangeLog (revision 40082) +++ ChangeLog (revision 40083) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Apr 3 20:52:49 2013 Tanaka Akira <akr@f...> + + * process.c: Describe the behavior which Ruby invokes a commandline + directly without shell if the commandline is simple enough. + [ruby-core:50459] [Bug #7489] + Wed Apr 3 20:27:37 2013 Tanaka Akira <akr@f...> * ext/extmk.rb (extmake): Invoke Logging::log_close in a ensure Index: process.c =================================================================== --- process.c (revision 40082) +++ process.c (revision 40083) @@ -2349,6 +2349,12 @@ static int rb_exec_without_timer_thread( https://github.com/ruby/ruby/blob/trunk/process.c#L2349 * The standard shell means always <code>"/bin/sh"</code> on Unix-like systems, * <code>ENV["RUBYSHELL"]</code> or <code>ENV["COMSPEC"]</code> on Windows NT series, and * similar. + * If _commandline_ is simple enough, + * no meta characters, no shell reserved word and no special built-in, + * Ruby invokes the command directly without shell. + * You can force shell invocation by adding ";" for _commandline_ (because ";" is a meta characetr). + * Note that this behavior is observable by pid obtained + * (return value of spawn() and IO#pid for IO.popen) is the pid of the invoked command, not shell. * * If two or more +string+ given, * the first is taken as a command name and -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/