From d3df72e22fd0c57201d620e6cf9a2d2e3a8a031c Mon Sep 17 00:00:00 2001 From: AzureMarker Date: Thu, 27 Jan 2022 20:24:34 -0800 Subject: [PATCH] Prevent popping the last segment of a path (ex. / or romfs:/) --- ctru-rs/examples/file-explorer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctru-rs/examples/file-explorer.rs b/ctru-rs/examples/file-explorer.rs index 8a249f9..a334301 100644 --- a/ctru-rs/examples/file-explorer.rs +++ b/ctru-rs/examples/file-explorer.rs @@ -57,7 +57,7 @@ impl<'a> FileExplorer<'a> { if input.contains(KeyPad::KEY_START) { break; - } else if input.contains(KeyPad::KEY_B) { + } else if input.contains(KeyPad::KEY_B) && self.path.components().count() > 1 { self.path.pop(); self.console.clear(); self.print_menu();