[前][次][番号順一覧][スレッド一覧]

ruby-changes:37310

From: nobu <ko1@a...>
Date: Sat, 24 Jan 2015 19:56:44 +0900 (JST)
Subject: [ruby-changes:37310] nobu:r49391 (trunk): dln_find.c: regular files only

nobu	2015-01-24 19:56:28 +0900 (Sat, 24 Jan 2015)

  New Revision: 49391

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49391

  Log:
    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]

  Modified files:
    trunk/ChangeLog
    trunk/dln_find.c
Index: dln_find.c
===================================================================
--- dln_find.c	(revision 49390)
+++ dln_find.c	(revision 49391)
@@ -278,11 +278,10 @@ dln_find_1(const char *fname, const char https://github.com/ruby/ruby/blob/trunk/dln_find.c#L278
 	}
 #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 */
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 49390)
+++ ChangeLog	(revision 49391)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jan 24 19:56:25 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@a...>
 
 	* vm_insnhelper.c (vm_throw_start): search the target to break

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]