13
0

use legalize_for_path() on filenames for export presets and formats

git-svn-id: svn://localhost/ardour2/branches/3.0@9126 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-03-12 20:16:16 +00:00
parent 12d538b0cf
commit 7060fe697e

View File

@ -184,7 +184,8 @@ ExportProfileManager::load_presets ()
ExportProfileManager::PresetPtr
ExportProfileManager::save_preset (string const & name)
{
string filename = export_config_dir.to_string() + "/" + name + export_preset_suffix;
string safe_name = legalize_for_path (name);
string filename = export_config_dir.to_string() + "/" + safe_name + export_preset_suffix;
if (!current_preset) {
current_preset.reset (new ExportPreset (filename, session));
@ -519,6 +520,10 @@ ExportProfileManager::save_format_to_disk (FormatPtr format)
string new_name = format->name();
new_name += export_format_suffix;
/* make sure its legal for the filesystem */
new_name = legalize_for_path (new_name);
sys::path new_path (export_config_dir);
new_path /= new_name;