Skip to content

Commit

Permalink
fix: remove extra period of extension
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaurencin authored and ckerr committed Sep 12, 2022
1 parent c14f52a commit 183dac7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion shell/browser/electron_download_manager_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bool GetRegistryDescriptionFromExtension(const std::string& file_ext,
// Set up a filter for a Save/Open dialog, |ext_desc| as the text descriptions
// of the |file_ext| types (optional), and (optionally) the default 'All Files'
// view. The purpose of the filter is to show only files of a particular type in
// a Windows Save/Open dialog box. The resulting filter is returned. The filter
// a Windows Save/Open dialog box. The resulting filter is returned. The filters
// created here are:
// 1. only files that have 'file_ext' as their extension
// 2. all files (only added if 'include_all_files' is true)
Expand Down Expand Up @@ -168,6 +168,10 @@ file_dialog::Filters FormatFilterForExtensions(
base::ReplaceChars(desc, "*", base::StringPiece(), &desc);
}

// Remove the preceeding '.' character from the extension.
size_t ext_index = ext.find_first_not_of('.');
if (ext_index != std::string::npos)
ext = ext.substr(ext_index);
result.push_back({desc, {ext}});
}

Expand Down

0 comments on commit 183dac7

Please sign in to comment.