1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

dln_find.c: regular files only

* dln_find.c (dln_find_1): search regular files only.  based on
  the patch by Alex Coomans in [ruby-core:67766].  [Bug #10776]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-01-24 10:56:28 +00:00
parent 26d0a2a3d6
commit ad3b5d6376
2 changed files with 7 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Sat Jan 24 19:56:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dln_find.c (dln_find_1): search regular files only. based on
the patch by Alex Coomans in [ruby-core:67766]. [Bug #10776]
Fri Jan 23 23:57:05 2015 Misumi Rize <r@ayase-e.li>
* vm_insnhelper.c (vm_throw_start): search the target to break

View file

@ -278,11 +278,10 @@ dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
}
#endif /* _WIN32 or __EMX__ */
if (stat(fbuf, &st) == 0) {
if (stat(fbuf, &st) == 0 && !S_ISDIR(st.st_mode)) {
if (exe_flag == 0) return fbuf;
/* looking for executable */
if (!S_ISDIR(st.st_mode) && eaccess(fbuf, X_OK) == 0)
return fbuf;
if (eaccess(fbuf, X_OK) == 0) return fbuf;
}
next:
/* if not, and no other alternatives, life is bleak */