Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/ntfs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Finck <colin@reactos.org>2021-10-15 00:33:03 +0300
committerColin Finck <colin@reactos.org>2021-10-15 00:33:03 +0300
commitc4a7bb9c8b12b47138a4172d868b52b60ce2e4d8 (patch)
treeca4a82dc0670f57fc3b8ef822efb9e57d5c55edc
parentdef734b62543c78200ae2070c3be8e49895dbfd4 (diff)
Fix ntfs-shell `get` command for a given $DATA stream.
-rw-r--r--examples/ntfs-shell/main.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/ntfs-shell/main.rs b/examples/ntfs-shell/main.rs
index 3df1b59..e4b8a22 100644
--- a/examples/ntfs-shell/main.rs
+++ b/examples/ntfs-shell/main.rs
@@ -466,8 +466,10 @@ where
T: Read + Seek,
{
// Extract any specific $DATA stream name from the file.
- let mid = arg.find(':').unwrap_or(arg.len());
- let (file_name, data_stream_name) = arg.split_at(mid);
+ let (file_name, data_stream_name) = match arg.find(':') {
+ Some(mid) => (&arg[..mid], &arg[mid + 1..]),
+ None => (arg, ""),
+ };
// Compose the output file name and try to create it.
// It must not yet exist, as we don't want to accidentally overwrite things.