mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-31 09:20:54 -08:00
(file_name_completion_stat): Use both lstat and stat.
This commit is contained in:
parent
81c735c099
commit
7e3cf34f8d
1 changed files with 7 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue