Fix make_relative_path() to support cases where target_path and bin_path

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 936d43d8423aa1306a8d4d2bc4fb4a6fb4c37116
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2005-12-23T22:34:22Z
Releases: 8.2.0
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.

Files

PathChange+/−
src/port/path.c modified +67 −16