aboutsummaryrefslogtreecommitdiffstats
path: root/src/dired.c
diff options
context:
space:
mode:
authorRichard M. Stallman1994-05-02 23:53:03 +0000
committerRichard M. Stallman1994-05-02 23:53:03 +0000
commit7e3cf34f8d5e888d0ff52a4345bcffc629dc591a (patch)
treef55134c920d9b296d8cfb9a9e0b56ebb93d361fd /src/dired.c
parent81c735c0990494962c4bd99063525240f73a2f77 (diff)
downloademacs-7e3cf34f8d5e888d0ff52a4345bcffc629dc591a.tar.gz
emacs-7e3cf34f8d5e888d0ff52a4345bcffc629dc591a.zip
(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 d8b9683514f..42391774db8 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -491,6 +491,7 @@ file_name_completion_stat (dirname, dp, st_addr)
491{ 491{
492 int len = NAMLEN (dp); 492 int len = NAMLEN (dp);
493 int pos = XSTRING (dirname)->size; 493 int pos = XSTRING (dirname)->size;
494 int value;
494 char *fullname = (char *) alloca (len + pos + 2); 495 char *fullname = (char *) alloca (len + pos + 2);
495 496
496 bcopy (XSTRING (dirname)->data, fullname, pos); 497 bcopy (XSTRING (dirname)->data, fullname, pos);
@@ -503,7 +504,12 @@ file_name_completion_stat (dirname, dp, st_addr)
503 fullname[pos + len] = 0; 504 fullname[pos + len] = 0;
504 505
505#ifdef S_IFLNK 506#ifdef S_IFLNK
506 return lstat (fullname, st_addr); 507 /* We want to return success if a link points to a nonexistent file,
508 but we want to return the status for what the link points to,
509 in case it is a directory. */
510 value = lstat (fullname, st_addr);
511 stat (fullname, st_addr);
512 return value;
507#else 513#else
508 return stat (fullname, st_addr); 514 return stat (fullname, st_addr);
509#endif 515#endif