From f3819ba83955685358fab05f195d74a98143b286 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Tue, 5 Dec 2017 18:50:39 -0800 Subject: [PATCH] tst: passthrough-dotnet: fix ReadDirectoryEntry when running fs over drive root --- tst/passthrough-dotnet/Program.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tst/passthrough-dotnet/Program.cs b/tst/passthrough-dotnet/Program.cs index a82c99af..d532f459 100644 --- a/tst/passthrough-dotnet/Program.cs +++ b/tst/passthrough-dotnet/Program.cs @@ -641,13 +641,16 @@ namespace passthrough if (null == FileDesc.FileSystemInfos) { if (null != Pattern) - Pattern = Pattern.Replace('<', '*').Replace('>', '?').Replace('=', '.'); + Pattern = Pattern.Replace('<', '*').Replace('>', '?').Replace('"', '.'); else Pattern = "*"; IEnumerable Enum = FileDesc.DirInfo.EnumerateFileSystemInfos(Pattern); SortedList List = new SortedList(); - List.Add(".", FileDesc.DirInfo); - List.Add("..", FileDesc.DirInfo.Parent); + if (null != FileDesc.DirInfo && null != FileDesc.DirInfo.Parent) + { + List.Add(".", FileDesc.DirInfo); + List.Add("..", FileDesc.DirInfo.Parent); + } foreach (FileSystemInfo Info in Enum) List.Add(Info.Name, Info); FileDesc.FileSystemInfos = new DictionaryEntry[List.Count];