--- dir.c 2016-11-05 16:49:29.000000000 +0100 +++ dir.c 2017-05-18 20:49:54.000000000 +0200 @@ -1517,7 +1517,11 @@ join_path(const char *path, long len, in #ifdef HAVE_GETATTRLIST static int +#ifdef HAVE_FGETATTRLIST is_case_sensitive(DIR *dirp) +#else +is_case_sensitive(const char *path) +#endif { struct { u_int32_t length; @@ -1528,7 +1532,11 @@ 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)) +#elif defined HAVE_GETATTRLIST + if (getattrlist(path, &al, attrbuf, sizeof(attrbuf), FSOPT_NOFOLLOW)) +#endif return -1; if (!(cap->valid[idx] & mask)) return -1; @@ -1823,8 +1831,12 @@ glob_helper( goto literally; } # endif -# ifdef HAVE_GETATTRLIST +# if defined HAVE_FGETATTRLIST || defined HAVE_GETATTRLIST +# ifdef HAVE_FGETATTRLIST if (is_case_sensitive(dirp) == 0) +# else + if (is_case_sensitive(path) == 0) +# endif flags |= FNM_CASEFOLD; # endif while ((dp = READDIR(dirp, enc)) != NULL) {