From 571234ffcbaf542dcf41ba8bc85d34720dce130c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 5 Jul 2009 00:40:58 +0000 Subject: more legalize_path hacks to handle stupidly named session git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5328 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/session_state.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'libs') diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index dff589c231..9b696a6254 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -601,7 +601,7 @@ Session::remove_pending_capture_state () string xml_path; xml_path = _path; - xml_path += _current_snapshot_name; + xml_path += legalize_for_path (_current_snapshot_name); xml_path += _pending_suffix; unlink (xml_path.c_str()); @@ -618,8 +618,8 @@ Session::rename_state (string old_name, string new_name) return; } - const string old_xml_path = _path + old_name + _statefile_suffix; - const string new_xml_path = _path + new_name + _statefile_suffix; + const string old_xml_path = _path + legalize_for_path (old_name) + _statefile_suffix; + const string new_xml_path = _path + legalize_for_path (new_name) + _statefile_suffix; if (rename (old_xml_path.c_str(), new_xml_path.c_str()) != 0) { error << string_compose(_("could not rename snapshot %1 to %2"), old_name, new_name) << endmsg; @@ -637,7 +637,7 @@ Session::remove_state (string snapshot_name) return; } - const string xml_path = _path + snapshot_name + _statefile_suffix; + const string xml_path = _path + legalize_for_path (snapshot_name) + _statefile_suffix; /* make a backup copy of the state file */ const string bak_path = xml_path + ".bak"; @@ -777,7 +777,7 @@ Session::load_state (string snapshot_name) if (!state_was_pending) { xmlpath = _path; - xmlpath += snapshot_name; + xmlpath += legalize_for_path (snapshot_name); xmlpath += _statefile_suffix; } @@ -824,7 +824,7 @@ Session::load_state (string snapshot_name) string backup_path; backup_path = _path; - backup_path += snapshot_name; + backup_path += legalize_for_path (snapshot_name); backup_path += "-1"; backup_path += _statefile_suffix; @@ -2666,7 +2666,7 @@ Session::find_all_sources_across_snapshots (set& result, bool exclude_th } this_snapshot_path = _path; - this_snapshot_path += _current_snapshot_name; + this_snapshot_path += legalize_for_path (_current_snapshot_name); this_snapshot_path += _statefile_suffix; for (vector::iterator i = state_files->begin(); i != state_files->end(); ++i) { -- cgit v1.2.3