Hi,

When I set ENV['PATH'] to nil/empty or some path not including the ruby 
installation diretory, Kernel#system will still happily launch executables 
located in the same directory as ruby itself. For example:

system('ruby -v')
ENV.delete 'PATH'
system('ruby -v')
system('iconv -l')
system('wget -V')

All of those will be executed on a typical Linux installation where ruby 
is located in /usr/bin together with most other programs. Also confirmed 
on Windows, except if you try to pipe/stream something, cmd.exe can't find 
the programs (as expected).

A worse effect is this, but on Windows only: If i set a path to an 
alternate Ruby installation, system("ruby.exe") runs the installed ruby:

ENV['PATH'] = "d:\\src\\rubyinstaller\\sandbox\\ruby_mingw\\bin"
system("ruby -v")
    => ruby 1.8.6 (2008-07-13 patchlevel 275) [i386-mingw32] 
system("ruby.exe -v")
    => ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

I suppose the last bit is a bug, but is the first Kernel#system behaviour 
intentional?

Lars