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

ruby-changes:47179

From: nagachika <ko1@a...>
Date: Mon, 10 Jul 2017 04:28:08 +0900 (JST)
Subject: [ruby-changes:47179] nagachika:r59294 (ruby_2_4): merge revision(s) 57248: [Backport #13573]

nagachika	2017-07-10 04:27:57 +0900 (Mon, 10 Jul 2017)

  New Revision: 59294

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

  Log:
    merge revision(s) 57248: [Backport #13573]
    
     dir.c: getattrlist on OSX 10.5
    
    * dir.c (is_case_sensitive): use getattrlist() if fgetattrlist()
      is unavailable, on OSX 10.5.  [ruby-core:68829] [Bug #11054]

  Modified directories:
    branches/ruby_2_4/
  Modified files:
    branches/ruby_2_4/dir.c
    branches/ruby_2_4/version.h
Index: ruby_2_4/dir.c
===================================================================
--- ruby_2_4/dir.c	(revision 59293)
+++ ruby_2_4/dir.c	(revision 59294)
@@ -1516,8 +1516,13 @@ join_path(const char *path, long len, in https://github.com/ruby/ruby/blob/trunk/ruby_2_4/dir.c#L1516
 }
 
 #ifdef HAVE_GETATTRLIST
+# if defined HAVE_FGETATTRLIST
+#   define is_case_sensitive(dirp, path) is_case_sensitive(dirp)
+# else
+#   define is_case_sensitive(dirp, path) is_case_sensitive(path)
+# endif
 static int
-is_case_sensitive(DIR *dirp)
+is_case_sensitive(DIR *dirp, const char *path)
 {
     struct {
 	u_int32_t length;
@@ -1528,8 +1533,13 @@ is_case_sensitive(DIR *dirp) https://github.com/ruby/ruby/blob/trunk/ruby_2_4/dir.c#L1533
     const int idx = VOL_CAPABILITIES_FORMAT;
     const uint32_t mask = VOL_CAP_FMT_CASE_SENSITIVE;
 
+#   if defined HAVE_FGETATTRLIST
     if (fgetattrlist(dirfd(dirp), &al, attrbuf, sizeof(attrbuf), FSOPT_NOFOLLOW))
 	return -1;
+#   else
+    if (getattrlist(path, &al, attrbuf, sizeof(attrbuf), FSOPT_NOFOLLOW))
+	return -1;
+#   endif
     if (!(cap->valid[idx] & mask))
 	return -1;
     return (cap->capabilities[idx] & mask) != 0;
@@ -1824,7 +1834,7 @@ glob_helper( https://github.com/ruby/ruby/blob/trunk/ruby_2_4/dir.c#L1834
 	}
 # endif
 # ifdef HAVE_GETATTRLIST
-	if (is_case_sensitive(dirp) == 0)
+	if (is_case_sensitive(dirp, path) == 0)
 	    flags |= FNM_CASEFOLD;
 # endif
 	while ((dp = READDIR(dirp, enc)) != NULL) {
Index: ruby_2_4/version.h
===================================================================
--- ruby_2_4/version.h	(revision 59293)
+++ ruby_2_4/version.h	(revision 59294)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1
 #define RUBY_VERSION "2.4.2"
 #define RUBY_RELEASE_DATE "2017-07-10"
-#define RUBY_PATCHLEVEL 134
+#define RUBY_PATCHLEVEL 135
 
 #define RUBY_RELEASE_YEAR 2017
 #define RUBY_RELEASE_MONTH 7
Index: ruby_2_4
===================================================================
--- ruby_2_4	(revision 59293)
+++ ruby_2_4	(revision 59294)

Property changes on: ruby_2_4
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r57248

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

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