aboutsummaryrefslogtreecommitdiffstats
path: root/src/dired.c
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1994-05-02 23:53:03 +0000
committerRichard M. Stallman <[email protected]>1994-05-02 23:53:03 +0000
commit7e3cf34f8d5e888d0ff52a4345bcffc629dc591a (patch)
treef55134c920d9b296d8cfb9a9e0b56ebb93d361fd /src/dired.c
parent81c735c0990494962c4bd99063525240f73a2f77 (diff)
(file_name_completion_stat): Use both lstat and stat.
Diffstat (limited to 'src/dired.c')
-rw-r--r--src/dired.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dired.c b/src/dired.c
index d8b9683514..42391774db 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -491,6 +491,7 @@ file_name_completion_stat (dirname, dp, st_addr)
{
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 @@ file_name_completion_stat (dirname, dp, st_addr)
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