summaryrefslogtreecommitdiff
path: root/src/dired.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dired.c')
-rw-r--r--src/dired.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/dired.c b/src/dired.c
index bdb71c46364..85af906c1da 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -895,6 +895,7 @@ so last access time will always be midnight of that day. */)
Lisp_Object dirname;
struct stat sdir;
#endif /* BSD4_2 */
+ int lstat_result;
/* An array to hold the mode string generated by filemodestring,
including its terminating space and null byte. */
@@ -922,7 +923,21 @@ so last access time will always be midnight of that day. */)
encoded = ENCODE_FILE (filename);
UNGCPRO;
- if (lstat (SSDATA (encoded), &s) < 0)
+#ifdef WINDOWSNT
+ /* We usually don't request accurate owner and group info, because
+ it can be very expensive on Windows to get that, and most callers
+ of 'lstat' don't need that. But here we do want that information
+ to be accurate. */
+ w32_stat_get_owner_group = 1;
+#endif
+
+ lstat_result = lstat (SSDATA (encoded), &s);
+
+#ifdef WINDOWSNT
+ w32_stat_get_owner_group = 0;
+#endif
+
+ if (lstat_result < 0)
return Qnil;
values[0] = (S_ISLNK (s.st_mode) ? Ffile_symlink_p (filename)