summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ln.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ln.c b/src/ln.c
index 5e480a2a4..abe88f5dd 100644
--- a/src/ln.c
+++ b/src/ln.c
@@ -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
)
{