From 51fc39e0e60b25fd2cba0e3fc5166129db4df192 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Fri, 31 May 2019 08:38:53 +0200 Subject: [PATCH] Backport path_get fix discovered in Win branch --- src/sys/unix/hostcalls/fs_helpers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sys/unix/hostcalls/fs_helpers.rs b/src/sys/unix/hostcalls/fs_helpers.rs index 5d1c70bd88..94a3b20268 100644 --- a/src/sys/unix/hostcalls/fs_helpers.rs +++ b/src/sys/unix/hostcalls/fs_helpers.rs @@ -149,7 +149,7 @@ pub fn path_get>( || (component.ends_with(b"/") && !needs_final_component) => { match openat( - *dir_stack.first().expect("dir_stack is never empty"), + *dir_stack.last().expect("dir_stack is never empty"), component, OFlag::O_RDONLY | OFlag::O_DIRECTORY | OFlag::O_NOFOLLOW, Mode::empty(),