From 1b2fdf7c1eb6666c74ef5b7700f87de6219a833e Mon Sep 17 00:00:00 2001 From: Patrick Meredith Date: Fri, 6 Sep 2019 23:20:13 -0400 Subject: [PATCH 1/2] Fix bug with ls globbing a single directory --- src/shell/filesystem_shell.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shell/filesystem_shell.rs b/src/shell/filesystem_shell.rs index 5b62d329a2..c2bd9e5b9a 100644 --- a/src/shell/filesystem_shell.rs +++ b/src/shell/filesystem_shell.rs @@ -106,8 +106,7 @@ impl Shell for FilesystemShell { if entries.len() == 1 { if let Ok(entry) = &entries[0] { if entry.is_dir() { - let entries = std::fs::read_dir(&full_path); - + let entries = std::fs::read_dir(&entry); let entries = match entries { Err(e) => { if let Some(s) = args.nth(0) { @@ -126,6 +125,7 @@ impl Shell for FilesystemShell { } Ok(o) => o, }; + for entry in entries { let entry = entry?; let filepath = entry.path(); From ea24571c22d3cc31fbc07b2b7589a9832a321a65 Mon Sep 17 00:00:00 2001 From: Patrick Meredith Date: Fri, 6 Sep 2019 23:24:29 -0400 Subject: [PATCH 2/2] Remove added newline --- src/shell/filesystem_shell.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/shell/filesystem_shell.rs b/src/shell/filesystem_shell.rs index c2bd9e5b9a..10ca864882 100644 --- a/src/shell/filesystem_shell.rs +++ b/src/shell/filesystem_shell.rs @@ -125,7 +125,6 @@ impl Shell for FilesystemShell { } Ok(o) => o, }; - for entry in entries { let entry = entry?; let filepath = entry.path();