From: Pixel Date: 2001-05-25T20:10:54+09:00 Subject: [ruby-talk:15711] bug in "system" PATH scanning? --=-=-= % cd /tmp % PATH=.:$PATH ruby -e 'p system("ruby -v")' ruby 1.6.3 (2001-03-22) [i586-linux-gnu] true % mkdir ruby % PATH=.:$PATH ruby -e 'p system("ruby -v")' false Aka, if you have a directory named the same as the binary before the binary in the search path, it will fail. This patch fix it. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=ruby-directories-are-not-executables.patch --- ruby/dln.c.pix Thu Feb 8 10:17:56 2001 +++ ruby/dln.c Fri May 25 13:03:51 2001 @@ -1669,7 +1669,7 @@ if (stat(fbuf, &st) == 0) { if (exe_flag == 0) return fbuf; /* looking for executable */ - if (eaccess(fbuf, X_OK) == 0) return fbuf; + if (!S_ISDIR(st.st_mode) && eaccess(fbuf, X_OK) == 0) return fbuf; } #else if (mac_fullpath = _macruby_exist_file_in_libdir_as_posix_name(fbuf)) { --=-=-= cu Pixel. PS: this is bothering me since i have ~/bin:~/bin/ruby:...:/usr/bin:... in my path --=-=-=--