]> granicus.if.org Git - postgresql/commit
Fix make_relative_path() to support cases where target_path and bin_path
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 23 Dec 2005 22:34:33 +0000 (22:34 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 23 Dec 2005 22:34:33 +0000 (22:34 +0000)
commit988fe9f7dde7d9b260343c518e80039ce479d870
treef3e9fefb9e3a3c19bc7b6c7b7182e9e25e3fb72d
parentfaefc812f8aa41c4875520640db0c4e6d5c2edca
Fix make_relative_path() to support cases where target_path and bin_path
differ by more than the last directory component.  Instead of insisting
that they match up to the last component, accept whatever common prefix
they have, and try to replace the non-matching part of bin_path with
the non-matching part of target_path in the actual executable's path.
In one way this is tighter than the old code, because it insists on
a match to the part of bin_path we want to substitute for, rather than
blindly stripping one directory component from the executable's path.
Per gripe from Martin Pitt and subsequent discussion.
src/port/path.c