From: Guido van Rossum Date: Tue, 8 Sep 1998 22:28:06 +0000 (+0000) Subject: Patch suggested by Perry Stoll -- os.path.normpath(".//x") returned X-Git-Tag: v1.5.2a2~318 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a063303693464992a9ab70856992cb169a5909e8;p=python Patch suggested by Perry Stoll -- os.path.normpath(".//x") returned "/x", should return "x". --- diff --git a/Lib/posixpath.py b/Lib/posixpath.py index a5c0de2dad..fb3b6a64f9 100644 --- a/Lib/posixpath.py +++ b/Lib/posixpath.py @@ -354,6 +354,8 @@ def normpath(path): while i < len(comps): if comps[i] == '.': del comps[i] + while i < len(comps) and comps[i] == '': + del comps[i] elif comps[i] == '..' and i > 0 and comps[i-1] not in ('', '..'): del comps[i-1:i+1] i = i-1