Merge pull request #392 from ChiahongHong/file-explorer

Prevent executing an executable file with the same name as the directory
This commit is contained in:
leo 2024-08-22 10:06:37 +08:00 committed by GitHub
commit e84d28b7b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -183,6 +183,7 @@ namespace SourceGit.Native
else
{
fullpath = new DirectoryInfo(path!).FullName;
fullpath += Path.DirectorySeparatorChar;
}
if (select)
@ -202,7 +203,7 @@ namespace SourceGit.Native
public void OpenWithDefaultEditor(string file)
{
var info = new FileInfo(file);
var start = new ProcessStartInfo("cmd", $"/c start {info.FullName}");
var start = new ProcessStartInfo("cmd", $"/c start \"\" \"{info.FullName}\"");
start.CreateNoWindow = true;
Process.Start(start);
}