Skip to content

Instantly share code, notes, and snippets.

@kosaki
Created September 16, 2015 03:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kosaki/ec317fe64c2e6ec4179e to your computer and use it in GitHub Desktop.
Save kosaki/ec317fe64c2e6ec4179e to your computer and use it in GitHub Desktop.
diff --git a/dir.c b/dir.c
index aed3ecaa..1bf90ee 100644
--- a/dir.c
+++ b/dir.c
@@ -1809,6 +1809,13 @@ glob_helper(
new_pathtype = path_noent;
#else
new_pathtype = dp->d_type;
+ #ifdef DT_UNKNOWN
+ if (new_pathtype == DT_UNKNOWN) {
+ if (do_lstat(buf, &st, flags, enc) == 0) {
+ new_pathtype = IFTODT(st.st_mode);
+ }
+ }
+ #endif
#endif
}
(END)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment