Browse Source

Bug fix: .NET assembly methods GetFileName and GetDirectoryName did not behave correctly when provided a filename without any path

Source commit: 2bedae873aea554ca6d7309303ee1bcfea4ea8a8
Martin Prikryl 7 years ago
parent
commit
90d98b3718
1 changed files with 2 additions and 2 deletions
  1. 2 2
      dotnet/RemotePath.cs

+ 2 - 2
dotnet/RemotePath.cs

@@ -174,7 +174,7 @@ namespace WinSCP
                 int i = path.LastIndexOf('/');
                 if (i < 0)
                 {
-                    result = null;
+                    result = string.Empty;
                 }
                 else if (i == 0)
                 {
@@ -226,7 +226,7 @@ namespace WinSCP
                 }
                 else
                 {
-                    result = string.Empty;
+                    result = path;
                 }
             }
             return result;