mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Patch suggested by Perry Stoll -- os.path.normpath(".//x") returned
"/x", should return "x".
This commit is contained in:
		
							parent
							
								
									86ad567c2e
								
							
						
					
					
						commit
						a063303693
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -354,6 +354,8 @@ def normpath(path): | ||||||
|     while i < len(comps): |     while i < len(comps): | ||||||
|         if comps[i] == '.': |         if comps[i] == '.': | ||||||
|             del 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 ('', '..'): |         elif comps[i] == '..' and i > 0 and comps[i-1] not in ('', '..'): | ||||||
|             del comps[i-1:i+1] |             del comps[i-1:i+1] | ||||||
|             i = i-1 |             i = i-1 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum