freebsd-src/bin/ln
Jilles Tjoelker dc00aa5dd6 ln: Allow a trailing slash when creating a link to a directory.
In the 'ln source... directory' synopsis, the basename of each source
determines the name of the created link. Determine this using basename(3)
instead of strrchr(..., '/') which is incorrect if the pathname ends in a
slash.

The patch is somewhat changed to allow for basename(3) implementations that
change the passed pathname, and to fix the -w option's checking also.
The code to compare directory entries only applies to hard links, which
cannot be created to directories using ln.

Example:
  ln -s /etc/defaults/ /tmp
This should create a symlink named defaults.

PR:		121568
Submitted by:	Ighighi
MFC after:	1 week
2010-04-21 21:57:03 +00:00
..
ln.1 Allow creating hard links to symlinks using ln(1). 2009-07-19 17:35:23 +00:00
ln.c ln: Allow a trailing slash when creating a link to a directory. 2010-04-21 21:57:03 +00:00
Makefile Default to WARNS=2. Binary builds that cannot handle this must explicitly 2001-12-04 01:57:47 +00:00
symlink.7 Expand *n't contractions. 2005-02-13 22:25:33 +00:00