aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorEnji Cooper <ngie@FreeBSD.org>2017-06-20 20:46:08 +0000
committerEnji Cooper <ngie@FreeBSD.org>2017-06-20 20:46:08 +0000
commit63bd650f4b966e560784b39b77c10263c4f7b555 (patch)
tree123e608787331466018a648cd324f8fdf279dd34 /bin
parentfb401369903f1312a08376a462c3319538dfacfa (diff)
Notes
Diffstat (limited to 'bin')
-rw-r--r--bin/ln/ln.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/ln/ln.c b/bin/ln/ln.c
index 70867f6569d4..04fb492ab5fe 100644
--- a/bin/ln/ln.c
+++ b/bin/ln/ln.c
@@ -245,11 +245,11 @@ linkit(const char *source, const char *target, int isdir)
/*
* If the target is a directory (and not a symlink if hflag),
- * append the source's name.
+ * append the source's name, unless Fflag is set.
*/
- if (isdir ||
+ if (!Fflag && (isdir ||
(lstat(target, &sb) == 0 && S_ISDIR(sb.st_mode)) ||
- (!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode))) {
+ (!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode)))) {
if (strlcpy(bbuf, source, sizeof(bbuf)) >= sizeof(bbuf) ||
(p = basename(bbuf)) == NULL ||
snprintf(path, sizeof(path), "%s/%s", target, p) >=