Skip to content

Commit

Permalink
imp - GFE() returns the file if IsFile is true
Browse files Browse the repository at this point in the history
---

This is a behavioral change that makes GetFilesystemEntries() return a
file path if IsFile is true after neutralizing it. This fixes several
regressions, such as empty file preview.

---

Type: imp
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Feb 6, 2025
1 parent b1d9a4c commit 37d57f2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions public/Nitrocid/Drivers/Filesystem/BaseFilesystemDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,11 @@ public virtual string[] GetFilesystemEntries(string Path, bool IsFile = false, b
try
{
Path = FS.NeutralizePath(Path);
// Check to see if we're calling from the root path
string Pattern = IsFile ? "" : "*";
if (IsFile)
return [Path];

// Check to see if we're calling from the root path
string Pattern = "*";
string pathRoot = FS.NeutralizePath(IOPath.GetPathRoot(Path));
if (pathRoot == Path)
{
Expand Down Expand Up @@ -810,7 +813,7 @@ public virtual string[] GetFilesystemEntries(string? Parent, string Pattern, boo
var Entries = Array.Empty<string>();
try
{
Parent = FS.NeutralizePath(Parent);
Parent = FS.NeutralizePath(Parent);

// Get the entries
if (Directory.Exists(Parent))
Expand Down

0 comments on commit 37d57f2

Please sign in to comment.