state.relpath: correct broken paths ending with /, etc.

Bug reported by Elliott Hird.  Based on a patch by Tim Allen, but I didn't
do it the same way.
This commit is contained in:
Avery Pennarun 2011-03-27 15:24:14 -04:00
commit 705722d612

View file

@ -120,6 +120,7 @@ def relpath(t, base):
if not _cwd: if not _cwd:
_cwd = os.getcwd() _cwd = os.getcwd()
t = os.path.normpath(os.path.join(_cwd, t)) t = os.path.normpath(os.path.join(_cwd, t))
base = os.path.normpath(base)
tparts = t.split('/') tparts = t.split('/')
bparts = base.split('/') bparts = base.split('/')
for tp,bp in zip(tparts,bparts): for tp,bp in zip(tparts,bparts):