diff options
Diffstat (limited to 'src/dired.c')
| -rw-r--r-- | src/dired.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/dired.c b/src/dired.c index b01ce8d4d8f..92c12846558 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -84,13 +84,6 @@ extern struct re_pattern_buffer *compile_pattern (Lisp_Object, | |||
| 84 | struct re_registers *, | 84 | struct re_registers *, |
| 85 | Lisp_Object, int, int); | 85 | Lisp_Object, int, int); |
| 86 | 86 | ||
| 87 | /* if system does not have symbolic links, it does not have lstat. | ||
| 88 | In that case, use ordinary stat instead. */ | ||
| 89 | |||
| 90 | #ifndef S_IFLNK | ||
| 91 | #define lstat stat | ||
| 92 | #endif | ||
| 93 | |||
| 94 | Lisp_Object Qdirectory_files; | 87 | Lisp_Object Qdirectory_files; |
| 95 | Lisp_Object Qdirectory_files_and_attributes; | 88 | Lisp_Object Qdirectory_files_and_attributes; |
| 96 | Lisp_Object Qfile_name_completion; | 89 | Lisp_Object Qfile_name_completion; |
| @@ -539,7 +532,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v | |||
| 539 | if (file_name_completion_stat (encoded_dir, dp, &st) < 0) | 532 | if (file_name_completion_stat (encoded_dir, dp, &st) < 0) |
| 540 | continue; | 533 | continue; |
| 541 | 534 | ||
| 542 | directoryp = ((st.st_mode & S_IFMT) == S_IFDIR); | 535 | directoryp = S_ISDIR (st.st_mode); |
| 543 | tem = Qnil; | 536 | tem = Qnil; |
| 544 | /* If all_flag is set, always include all. | 537 | /* If all_flag is set, always include all. |
| 545 | It would not actually be helpful to the user to ignore any possible | 538 | It would not actually be helpful to the user to ignore any possible |
| @@ -843,20 +836,16 @@ file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_ad | |||
| 843 | memcpy (fullname + pos, dp->d_name, len); | 836 | memcpy (fullname + pos, dp->d_name, len); |
| 844 | fullname[pos + len] = 0; | 837 | fullname[pos + len] = 0; |
| 845 | 838 | ||
| 846 | #ifdef S_IFLNK | ||
| 847 | /* We want to return success if a link points to a nonexistent file, | 839 | /* We want to return success if a link points to a nonexistent file, |
| 848 | but we want to return the status for what the link points to, | 840 | but we want to return the status for what the link points to, |
| 849 | in case it is a directory. */ | 841 | in case it is a directory. */ |
| 850 | value = lstat (fullname, st_addr); | 842 | value = lstat (fullname, st_addr); |
| 851 | stat (fullname, st_addr); | 843 | if (value == 0 && S_ISLNK (st_addr->st_mode)) |
| 852 | return value; | 844 | stat (fullname, st_addr); |
| 853 | #else | ||
| 854 | value = stat (fullname, st_addr); | ||
| 855 | #ifdef MSDOS | 845 | #ifdef MSDOS |
| 856 | _djstat_flags = save_djstat_flags; | 846 | _djstat_flags = save_djstat_flags; |
| 857 | #endif /* MSDOS */ | 847 | #endif /* MSDOS */ |
| 858 | return value; | 848 | return value; |
| 859 | #endif /* S_IFLNK */ | ||
| 860 | } | 849 | } |
| 861 | 850 | ||
| 862 | Lisp_Object | 851 | Lisp_Object |