bug 9811; Relative media path incorrectly calculated for Windows

This commit is contained in:
prculley 2016-12-01 10:23:27 -06:00
parent 27c2b0c81d
commit e94696ecf0

View File

@ -137,8 +137,12 @@ def relative_path(original, base):
base_list = [_f for _f in base_list if _f]
target_list = [_f for _f in target_list if _f]
i = -1
# base path is normcase (lower case on Windows) so compare target in lower
# on Windows as well
for i in range(min(len(base_list), len(target_list))):
if base_list[i] != target_list[i]: break
if base_list[i] != (target_list[i].lower() if win()
else target_list[i]):
break
else:
#if break did not happen we are here at end, and add 1.
i += 1