summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-30 11:00:50 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-30 11:00:50 +0000
commit1f106a915e154e8d2de285e60ed8b8fd59842496 (patch)
treec595fc52ebda1319c776259c64ea26a10f2929b7
parent538ba389836b090be5c913cdfe820d3d3f626e2b (diff)
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@59223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--dir.c14
-rw-r--r--version.h2
3 files changed, 18 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c3308463f..a4d63c76b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jun 30 20:00:18 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (is_case_sensitive): use getattrlist() if fgetattrlist() is
+ unavailable, on OSX 10.5. [Bug #11054]
+
Fri Jun 30 19:58:16 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
* tool/mkconfig.rb (RbConfig): prefix SDKROOT to oldincludedir
diff --git a/dir.c b/dir.c
index 6a63172e85..7376d5df1c 100644
--- a/dir.c
+++ b/dir.c
@@ -1470,8 +1470,13 @@ join_path(const char *path, long len, int dirsep, const char *name, size_t namle
}
#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;
@@ -1482,8 +1487,13 @@ is_case_sensitive(DIR *dirp)
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;
@@ -1778,7 +1788,7 @@ glob_helper(
}
# 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) {
diff --git a/version.h b/version.h
index bb57cf7181..91cc6cb3fc 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.3.5"
#define RUBY_RELEASE_DATE "2017-06-30"
-#define RUBY_PATCHLEVEL 319
+#define RUBY_PATCHLEVEL 320
#define RUBY_RELEASE_YEAR 2017
#define RUBY_RELEASE_MONTH 6