mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Revert "dir.c: fix glob with base when no DT_UNKNOWN"
This reverts commit r63982. It breaks build on Solaris 11. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cd2eaf2a33
commit
f1186a3d38
1 changed files with 7 additions and 7 deletions
14
dir.c
14
dir.c
|
@ -1380,10 +1380,10 @@ typedef struct {
|
||||||
|
|
||||||
/* System call with warning */
|
/* System call with warning */
|
||||||
static int
|
static int
|
||||||
do_stat(int fd, size_t baselen, const char *path, struct stat *pst, int flags, rb_encoding *enc)
|
do_stat(int fd, const char *path, struct stat *pst, int flags, rb_encoding *enc)
|
||||||
{
|
{
|
||||||
#if USE_OPENDIR_AT
|
#if USE_OPENDIR_AT
|
||||||
int ret = fstatat(fd, path + baselen, pst, 0);
|
int ret = fstatat(fd, path, pst, 0);
|
||||||
#else
|
#else
|
||||||
int ret = STAT(path, pst);
|
int ret = STAT(path, pst);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1395,10 +1395,10 @@ do_stat(int fd, size_t baselen, const char *path, struct stat *pst, int flags, r
|
||||||
|
|
||||||
#if defined HAVE_LSTAT || defined lstat || USE_OPENDIR_AT
|
#if defined HAVE_LSTAT || defined lstat || USE_OPENDIR_AT
|
||||||
static int
|
static int
|
||||||
do_lstat(int fd, size_t baselen, const char *path, struct stat *pst, int flags, rb_encoding *enc)
|
do_lstat(int fd, const char *path, struct stat *pst, int flags, rb_encoding *enc)
|
||||||
{
|
{
|
||||||
#if USE_OPENDIR_AT
|
#if USE_OPENDIR_AT
|
||||||
int ret = fstatat(fd, path + baselen, pst, AT_SYMLINK_NOFOLLOW);
|
int ret = fstatat(fd, path, pst, AT_SYMLINK_NOFOLLOW);
|
||||||
#else
|
#else
|
||||||
int ret = lstat(path, pst);
|
int ret = lstat(path, pst);
|
||||||
#endif
|
#endif
|
||||||
|
@ -2047,7 +2047,7 @@ glob_helper(
|
||||||
|
|
||||||
if (*base) {
|
if (*base) {
|
||||||
if (match_all && pathtype == path_unknown) {
|
if (match_all && pathtype == path_unknown) {
|
||||||
if (do_lstat(fd, 0, base, &st, flags, enc) == 0) {
|
if (do_lstat(fd, base, &st, flags, enc) == 0) {
|
||||||
pathtype = IFTODT(st.st_mode);
|
pathtype = IFTODT(st.st_mode);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -2055,7 +2055,7 @@ glob_helper(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (match_dir && (pathtype == path_unknown || pathtype == path_symlink)) {
|
if (match_dir && (pathtype == path_unknown || pathtype == path_symlink)) {
|
||||||
if (do_stat(fd, 0, base, &st, flags, enc) == 0) {
|
if (do_stat(fd, base, &st, flags, enc) == 0) {
|
||||||
pathtype = IFTODT(st.st_mode);
|
pathtype = IFTODT(st.st_mode);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -2167,7 +2167,7 @@ glob_helper(
|
||||||
if (recursive && dotfile < ((flags & FNM_DOTMATCH) ? 2 : 1) &&
|
if (recursive && dotfile < ((flags & FNM_DOTMATCH) ? 2 : 1) &&
|
||||||
new_pathtype == path_unknown) {
|
new_pathtype == path_unknown) {
|
||||||
/* RECURSIVE never match dot files unless FNM_DOTMATCH is set */
|
/* RECURSIVE never match dot files unless FNM_DOTMATCH is set */
|
||||||
if (do_lstat(fd, name - buf, buf, &st, flags, enc) == 0)
|
if (do_lstat(fd, buf, &st, flags, enc) == 0)
|
||||||
new_pathtype = IFTODT(st.st_mode);
|
new_pathtype = IFTODT(st.st_mode);
|
||||||
else
|
else
|
||||||
new_pathtype = path_noent;
|
new_pathtype = path_noent;
|
||||||
|
|
Loading…
Reference in a new issue