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:27 +0000 (22:34 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 23 Dec 2005 22:34:27 +0000 (22:34 +0000)
commitd69d75db77ba1ae95f5c4fe4090ef09e7e2a4587
tree17e71be5496a1220b514ffbfc66fc4abb888e7cd
parentb9fe86a40461cc11ff616c6dd3eec5a3b8e6c678
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