diff options
author | Jim Meyering <jim@meyering.net> | 1997-09-15 14:02:47 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1997-09-15 14:02:47 +0000 |
commit | c2bbb8e875e989f9d3234a116d15afeb9f0125fc (patch) | |
tree | 74f7c17ffccc1524966f8c76a974342a24f49811 /src | |
parent | 1822e3bd6849120d5f02dfadd7a194a853d45779 (diff) | |
download | coreutils-c2bbb8e875e989f9d3234a116d15afeb9f0125fc.tar.xz |
(do_link): Perform S_ISLNK test only if lstat succeeded.
Diffstat (limited to 'src')
-rw-r--r-- | src/ln.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -199,8 +199,9 @@ do_link (const char *source, const char *dest) && S_ISDIR (dest_stats.st_mode)) #ifdef S_ISLNK || (dereference_dest_dir_symlinks - && (S_ISLNK (dest_stats.st_mode) - && isdir (dest))) + && (lstat_status == 0 + && S_ISLNK (dest_stats.st_mode) + && isdir (dest))) #endif ) { |