Fix path lookup
This commit is contained in:
		
							parent
							
								
									0d762918e2
								
							
						
					
					
						commit
						5b3aeb4a9f
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -69,7 +69,7 @@ impl Context {
 | 
			
		|||
                cwd.clone()
 | 
			
		||||
            } else if path == b".." {
 | 
			
		||||
                cwd[..cwd[..cwd.len() - 1]
 | 
			
		||||
                                   .iter().rposition(|&b| b == b'/')
 | 
			
		||||
                                   .iter().rposition(|&b| b == b'/' || b == b':')
 | 
			
		||||
                                   .map_or(cwd.len(), |i| i + 1)]
 | 
			
		||||
                   .to_vec()
 | 
			
		||||
            } else if path.starts_with(b"./") {
 | 
			
		||||
| 
						 | 
				
			
			@ -78,7 +78,7 @@ impl Context {
 | 
			
		|||
                canon
 | 
			
		||||
            } else if path.starts_with(b"../") {
 | 
			
		||||
                let mut canon = cwd[..cwd[..cwd.len() - 1]
 | 
			
		||||
                                   .iter().rposition(|&b| b == b'/')
 | 
			
		||||
                                   .iter().rposition(|&b| b == b'/' || b == b':')
 | 
			
		||||
                                   .map_or(cwd.len(), |i| i + 1)]
 | 
			
		||||
                   .to_vec();
 | 
			
		||||
                canon.extend_from_slice(&path[3..]);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue