ln: --relative: fix updating of existing symlinks
commite52293aa7fcf283758f97bc9bcc945707ccbce0a
authorRémy Lefevre <lefevreremy@gmail.com>
Tue, 2 Apr 2013 01:48:28 +0000 (2 02:48 +0100)
committerPádraig Brady <P@draigBrady.com>
Thu, 4 Apr 2013 01:46:35 +0000 (4 02:46 +0100)
treed663b5fd9420298f1032c623589fd23902f0d7e8
parent20d7bce0f7e57d9a98f0ee811e31c757e9fedfff
ln: --relative: fix updating of existing symlinks

Don't dereference an existing symlink being replaced.
I.E. generate the symlink relative to the symlink's containing dir,
rather than to some arbitrary place it points to.

* src/ln.c (convert_abs_rel): Don't consider the final component
of the symlink name when canonicalizing, as we want to avoid
dereferencing the final component.
* tests/ln/relative.sh: Add a test case.
* NEWS: Mention the fix.
Resolves http://bugs.gnu.org/14116
NEWS
src/ln.c
tests/ln/relative.sh