]> 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:22 +0000 (22:34 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 23 Dec 2005 22:34:22 +0000 (22:34 +0000)
commit936d43d8423aa1306a8d4d2bc4fb4a6fb4c37116
treef74cb5741f2147798c03db0de41ce3adc0151086
parent98b3c3c450b9c3133f28375dc15c9c9b9bedd820
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