From d0678b58ab34f9afae099afc839430bdcd91aaac Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 23 Jan 2012 19:51:34 -0500 Subject: [PATCH] make glob mark symlinks-to-directories with the GLOB_MARK flag POSIX is unclear on whether it should, but all historical implementations seem to behave this way, and it seems more useful to applications. --- src/regex/glob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/regex/glob.c b/src/regex/glob.c index bbe78f7d..3476e010 100644 --- a/src/regex/glob.c +++ b/src/regex/glob.c @@ -117,7 +117,7 @@ static int match_in_dir(const char *d, const char *p, int flags, int (*errfunc)( } else { int mark = 0; if (flags & GLOB_MARK) { - if (de->d_type) + if (de->d_type && !S_ISLNK(de->d_type<<12)) mark = S_ISDIR(de->d_type<<12); else { struct stat st; -- 2.25.1