summaryrefslogtreecommitdiffstats
path: root/src/pathutil.rs
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2016-09-16 06:58:10 -0400
committerAndrew Gallant <jamslam@gmail.com>2016-09-16 06:58:10 -0400
commit8203a80ac7f010e32f8302822787eb9b5de8c9be (patch)
tree19faf05deb003fd5d8298b79a142f6fbd0809fc3 /src/pathutil.rs
parent0e46171e3b189b2bd89f45c3a492dea36361d8bc (diff)
fix tests
Diffstat (limited to 'src/pathutil.rs')
-rw-r--r--src/pathutil.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pathutil.rs b/src/pathutil.rs
index e92416e5..3cc92f7b 100644
--- a/src/pathutil.rs
+++ b/src/pathutil.rs
@@ -61,11 +61,11 @@ pub fn file_name<'a, P: AsRef<Path> + ?Sized>(
let mut last_slash = 0;
for (i, &b) in path.iter().enumerate().rev() {
if b == b'/' {
- last_slash = i;
+ last_slash = i + 1;
break;
}
}
- Some(OsStr::from_bytes(&path[last_slash + 1..]))
+ Some(OsStr::from_bytes(&path[last_slash..]))
}
/// The final component of the path, if it is a normal file.