(AddSelectionExec): use FileNameGlob class for matching.

This commit is contained in:
morkt 2016-03-06 15:18:22 +04:00
parent 05aa1568ea
commit 1bed5aeb83

View File

@ -1132,8 +1132,7 @@ namespace GARbro.GUI
CurrentDirectory.SelectAll();
return;
}
var mask = Regex.Escape (selection.Mask.Text).Replace (@"\*", ".*").Replace (@"\?", ".");
var glob = new Regex ("^"+mask+"$", RegexOptions.IgnoreCase);
var glob = new FileNameGlob (selection.Mask.Text);
var matching = ViewModel.Where (entry => glob.IsMatch (entry.Name));
if (!matching.Any())
{