Skip to content
Snippets Groups Projects
Commit 750a2c1f authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Fix path lookup

parent 879d582e
No related branches found
No related tags found
No related merge requests found
...@@ -69,7 +69,7 @@ impl Context { ...@@ -69,7 +69,7 @@ impl Context {
cwd.clone() cwd.clone()
} else if path == b".." { } else if path == b".." {
cwd[..cwd[..cwd.len() - 1] cwd[..cwd[..cwd.len() - 1]
.iter().rposition(|&b| b == b'/') .iter().rposition(|&b| b == b'/' || b == b':')
.map_or(cwd.len(), |i| i + 1)] .map_or(cwd.len(), |i| i + 1)]
.to_vec() .to_vec()
} else if path.starts_with(b"./") { } else if path.starts_with(b"./") {
...@@ -78,7 +78,7 @@ impl Context { ...@@ -78,7 +78,7 @@ impl Context {
canon canon
} else if path.starts_with(b"../") { } else if path.starts_with(b"../") {
let mut canon = cwd[..cwd[..cwd.len() - 1] 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)] .map_or(cwd.len(), |i| i + 1)]
.to_vec(); .to_vec();
canon.extend_from_slice(&path[3..]); canon.extend_from_slice(&path[3..]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment