code_review: PR #1442

Trim both `\` (on Windows) and `/` (on Linux/macOS) characters at the end of path

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2025-06-21 10:42:19 +08:00
parent 20daa584e3
commit 221e964df0

View File

@@ -26,7 +26,7 @@ namespace SourceGit.Views
{
var folder = selected[0];
var folderPath = folder is { Path: { IsAbsoluteUri: true } path } ? path.LocalPath : folder?.Path.ToString();
TxtLocation.Text = folderPath.TrimEnd('\\');
TxtLocation.Text = folderPath.TrimEnd(['\\', '/']);
}
}
catch (Exception exception)