Browse Source

Reusing RemotePath.AddDirectorySeparator

(cherry picked from commit 2f5bb1ba7475a1f0cbeeece872a2f90b78af7930)

Source commit: 92f04c78889e0ebb9c84f57a64275211cbe1f440
Martin Prikryl 4 years ago
parent
commit
338bc40737
1 changed files with 1 additions and 4 deletions
  1. 1 4
      dotnet/Session.cs

+ 1 - 4
dotnet/Session.cs

@@ -800,10 +800,7 @@ namespace WinSCP
                     filemask = "*";
                 }
                 string localPath = Path.Combine(localDirectory, filemask);
-                const string remoteSeparator = "/";
-                string remotePath =
-                    remoteDirectory +
-                    (remoteDirectory.EndsWith(remoteSeparator, StringComparison.Ordinal) ? string.Empty : remoteSeparator);
+                string remotePath = RemotePath.AddDirectorySeparator(remoteDirectory);
                 return PutFiles(localPath, remotePath, remove, options);
             }
         }