diff --git a/Tools/scripts/patchtool.py b/Tools/scripts/patchtool.py index 08f8f528851d..845a7ff92c6c 100755 --- a/Tools/scripts/patchtool.py +++ b/Tools/scripts/patchtool.py @@ -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 == '':