]> granicus.if.org Git - python/commitdiff
Patch suggested by Perry Stoll -- os.path.normpath(".//x") returned
authorGuido van Rossum <guido@python.org>
Tue, 8 Sep 1998 22:28:06 +0000 (22:28 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 8 Sep 1998 22:28:06 +0000 (22:28 +0000)
"/x", should return "x".

Lib/posixpath.py

index a5c0de2dad5e876dbe157d0851126beeab18a0df..fb3b6a64f987638facd72da654d7ce4db5f61dcf 100644 (file)
@@ -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