realpath: fix problems with root handling
commit5e264bf248128735aaba4e368f3875680d2ca438
authorEric Blake <eblake@redhat.com>
Sat, 4 Feb 2012 18:50:53 +0000 (4 11:50 -0700)
committerEric Blake <eblake@redhat.com>
Thu, 15 Mar 2012 16:28:40 +0000 (15 10:28 -0600)
tree7abce99252f01893a3f0d24cdd93e4836ac01de8
parenta84286ce7a2e7722eb38280bcbca7fabc647be95
realpath: fix problems with root handling

When --relative-base is /, all other paths should be treated as
relative (except for // where it matters).

Also, on platforms like Cygwin where / and // are distinct, realpath
was incorrectly collapsing // into /.  http://debbugs.gnu.org/10472.

* src/realpath.c (path_prefix, path_common_prefix): Treat /
and // as having no common match.
(relpath): Allow for no match even without --relative-base.
* NEWS: Document this.
NEWS
src/realpath.c