Skip to content

Commit 1cfb69d

Browse files
committed
Use Path.TrimEndingDirectorySeparator
1 parent ebe4069 commit 1cfb69d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Views/QuickAccessLinkSettings.xaml.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Flow.Launcher.Plugin.Explorer.Search;
99
using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks;
1010
using CommunityToolkit.Mvvm.ComponentModel;
11+
using System.IO;
1112

1213
namespace Flow.Launcher.Plugin.Explorer.Views;
1314

@@ -168,8 +169,8 @@ private void SelectPath_OnClick(object commandParameter, RoutedEventArgs e)
168169
string.IsNullOrEmpty(path))
169170
return;
170171

171-
// Remove the last \\ or / in path if it exists because it can cause path type checking issues
172-
path = path.TrimEnd('\\', '/');
172+
// Remove ending directory separator because it can cause path type checking issues
173+
path = Path.TrimEndingDirectorySeparator(path);
173174
SelectedPath = path;
174175
}
175176
else // Folder selection
@@ -184,8 +185,8 @@ private void SelectPath_OnClick(object commandParameter, RoutedEventArgs e)
184185
string.IsNullOrEmpty(path))
185186
return;
186187

187-
// Remove the last \\ or / in path if it exists because it can cause path type checking issues
188-
path = path.TrimEnd('\\', '/');
188+
// Remove ending directory separator because it can cause path type checking issues
189+
path = Path.TrimEndingDirectorySeparator(path);
189190
SelectedPath = path;
190191
}
191192
}

0 commit comments

Comments
 (0)