]> git.ipfire.org Git - thirdparty/coreutils.git/commit
realpath: optimize --relative-base usage
authorEric Blake <eblake@redhat.com>
Wed, 14 Mar 2012 19:42:59 +0000 (13:42 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 15 Mar 2012 19:28:19 +0000 (13:28 -0600)
commitbe17e3b98a178ea6e2c973bf49282f11f7060353
treefc13d79392e4c5e416a9838b33c6f8f5e14f2d1a
parent9f5aa4850133976eee22dcc0b506d7b632cd674c
realpath: optimize --relative-base usage

There is no need to recompute for every path being visited whether
the base is a prefix of the relative location.

* src/realpath.c (relpath): Hoist base check...
(main): ...here.
Based on a suggestion by Pádraig Brady.
src/realpath.c