diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | dln_find.c | 5 |
2 files changed, 7 insertions, 3 deletions
@@ -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 diff --git a/dln_find.c b/dln_find.c index 56a19818cf..74bedddfec 100644 --- a/dln_find.c +++ b/dln_find.c @@ -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 */ |