From 431ea61ff8bbb4cd77030cc01325dd896247d910 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 1 Jul 2016 22:55:15 +0900 Subject: [PATCH] Don't use MatchesExtension for matching filters MatchesExtension compares double extensions like .tar.gz, which does not match the filters. --- atom/browser/ui/file_dialog_gtk.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/atom/browser/ui/file_dialog_gtk.cc b/atom/browser/ui/file_dialog_gtk.cc index dcb7bea86b..eba1813780 100644 --- a/atom/browser/ui/file_dialog_gtk.cc +++ b/atom/browser/ui/file_dialog_gtk.cc @@ -211,7 +211,9 @@ base::FilePath FileChooserDialog::AddExtensionForFilename( const auto& extensions = filters_[i].second; for (const auto& extension : extensions) { - if (extension == "*" || path.MatchesExtension("." + extension)) + if (extension == "*" || + base::EndsWith(path.value(), "." + extension, + base::CompareCase::INSENSITIVE_ASCII)) return path; }