Fix a bug that in some rare cases may lead to a patch not being properly

generated.
This commit is contained in:
Maxim Sobolev 2001-07-31 07:41:01 +00:00
parent d2911a79af
commit a2bc5891ae
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=45648

View file

@ -157,6 +157,8 @@ def getrelpath(path, wrksrc):
path = os.path.abspath(path)
wrksrc = os.path.abspath(wrksrc)
commonpart = os.path.commonprefix((path, wrksrc))
while commonpart[-1:] != '/':
commonpart = commonpart[:-1]
path = path[len(commonpart):]
wrksrc = wrksrc[len(commonpart):]
if wrksrc == '':