ruby-changes:38468
From: nagachika <ko1@a...>
Date: Wed, 20 May 2015 04:06:58 +0900 (JST)
Subject: [ruby-changes:38468] nagachika:r50549 (ruby_2_2): merge revision(s) 50218: [Backport #11054] [Backport #11069]
nagachika 2015-05-20 04:06:36 +0900 (Wed, 20 May 2015) New Revision: 50549 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50549 Log: merge revision(s) 50218: [Backport #11054] [Backport #11069] * dir.c (need_normalization): use getattrlist() if fgetattrlist() is unavailable, on OSX 10.5. [ruby-core:68829] [Bug #11054] Modified directories: branches/ruby_2_2/ Modified files: branches/ruby_2_2/ChangeLog branches/ruby_2_2/configure.in branches/ruby_2_2/dir.c branches/ruby_2_2/version.h Index: ruby_2_2/configure.in =================================================================== --- ruby_2_2/configure.in (revision 50548) +++ ruby_2_2/configure.in (revision 50549) @@ -2036,6 +2036,7 @@ AC_CHECK_FUNCS(fchmod) https://github.com/ruby/ruby/blob/trunk/ruby_2_2/configure.in#L2036 AC_CHECK_FUNCS(fchown) AC_CHECK_FUNCS(fcntl) AC_CHECK_FUNCS(fdatasync) +AC_CHECK_FUNCS(fgetattrlist) AC_CHECK_FUNCS(fmod) AC_CHECK_FUNCS(fsync) AC_CHECK_FUNCS(ftruncate) Index: ruby_2_2/ChangeLog =================================================================== --- ruby_2_2/ChangeLog (revision 50548) +++ ruby_2_2/ChangeLog (revision 50549) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Wed May 20 03:46:11 2015 Nobuyoshi Nakada <nobu@r...> + + * dir.c (need_normalization): use getattrlist() if fgetattrlist() + is unavailable, on OSX 10.5. [ruby-core:68829] [Bug #11054] + Wed May 20 03:25:34 2015 Nobuyoshi Nakada <nobu@r...> * proc.c (proc_binding): replicate env from method object, and Index: ruby_2_2/dir.c =================================================================== --- ruby_2_2/dir.c (revision 50548) +++ ruby_2_2/dir.c (revision 50549) @@ -103,13 +103,23 @@ char *strchr(char*,char); https://github.com/ruby/ruby/blob/trunk/ruby_2_2/dir.c#L103 #include <sys/mount.h> #include <sys/vnode.h> +# if defined HAVE_FGETATTRLIST || !defined HAVE_GETATTRLIST +# define need_normalization(dirp, path) need_normalization(dirp) +# else +# define need_normalization(dirp, path) need_normalization(path) +# endif static inline int -need_normalization(DIR *dirp) +need_normalization(DIR *dirp, const char *path) { -# ifdef HAVE_GETATTRLIST +# if defined HAVE_FGETATTRLIST || defined HAVE_GETATTRLIST u_int32_t attrbuf[SIZEUP32(fsobj_tag_t)]; struct attrlist al = {ATTR_BIT_MAP_COUNT, 0, ATTR_CMN_OBJTAG,}; - if (!fgetattrlist(dirfd(dirp), &al, attrbuf, sizeof(attrbuf), 0)) { +# if defined HAVE_FGETATTRLIST + int ret = fgetattrlist(dirfd(dirp), &al, attrbuf, sizeof(attrbuf), 0); +# else + int ret = getattrlist(path, &al, attrbuf, sizeof(attrbuf), 0); +# endif + if (!ret) { const fsobj_tag_t *tag = (void *)(attrbuf+1); switch (*tag) { case VT_HFS: @@ -694,7 +704,7 @@ dir_each(VALUE dir) https://github.com/ruby/ruby/blob/trunk/ruby_2_2/dir.c#L704 RETURN_ENUMERATOR(dir, 0, 0); GetDIR(dir, dirp); rewinddir(dirp->dir); - IF_NORMALIZE_UTF8PATH(norm_p = need_normalization(dirp->dir)); + IF_NORMALIZE_UTF8PATH(norm_p = need_normalization(dirp->dir, RSTRING_PTR(dirp->path))); while ((dp = READDIR(dirp->dir, dirp->enc)) != NULL) { const char *name = dp->d_name; size_t namlen = NAMLEN(dp); @@ -1661,7 +1671,7 @@ glob_helper( https://github.com/ruby/ruby/blob/trunk/ruby_2_2/dir.c#L1671 # endif return 0; } - IF_NORMALIZE_UTF8PATH(norm_p = need_normalization(dirp)); + IF_NORMALIZE_UTF8PATH(norm_p = need_normalization(dirp, *path ? path : ".")); # if NORMALIZE_UTF8PATH if (!(norm_p || magical || recursive)) { Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 50548) +++ ruby_2_2/version.h (revision 50549) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.3" #define RUBY_RELEASE_DATE "2015-05-20" -#define RUBY_PATCHLEVEL 108 +#define RUBY_PATCHLEVEL 109 #define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_MONTH 5 Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r50218 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/