changeset 7286:15bf025e8f8c

(file_name_completion_stat): Use both lstat and stat.
author Richard M. Stallman <rms@gnu.org>
date Mon, 02 May 1994 23:53:03 +0000
parents 27e6ef8494b2
children 0e89007c19c6
files src/dired.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/dired.c	Mon May 02 22:26:50 1994 +0000
+++ b/src/dired.c	Mon May 02 23:53:03 1994 +0000
@@ -491,6 +491,7 @@
 {
   int len = NAMLEN (dp);
   int pos = XSTRING (dirname)->size;
+  int value;
   char *fullname = (char *) alloca (len + pos + 2);
 
   bcopy (XSTRING (dirname)->data, fullname, pos);
@@ -503,7 +504,12 @@
   fullname[pos + len] = 0;
 
 #ifdef S_IFLNK
-  return lstat (fullname, st_addr);
+  /* We want to return success if a link points to a nonexistent file,
+     but we want to return the status for what the link points to,
+     in case it is a directory.  */
+  value = lstat (fullname, st_addr);
+  stat (fullname, st_addr);
+  return value;
 #else
   return stat (fullname, st_addr);
 #endif