summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-07-18 15:04:00 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-07-18 15:04:00 +0000
commit5d8cf171212cb2de6e82ca329f8d19313fa7db07 (patch)
treecac5aa75e94fe801734505f7391a4eb1f54e60b2 /libs/ardour
parent8426588d6ed114060aa296fd529c1c760f041810 (diff)
don't try (and fail) to rename the history file if it doesn't exist
git-svn-id: svn://localhost/ardour2/branches/3.0@9892 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/session_state.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index c8323047eb..0973e294c5 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -3773,14 +3773,18 @@ Session::rename (const std::string& new_name)
}
/* history file */
+
oldstr = Glib::build_filename (newpath, _current_snapshot_name) + history_suffix;
- newstr = Glib::build_filename (newpath, legal_name) + history_suffix;
-
- cerr << "Rename " << oldstr << " => " << newstr << endl;
- if (RENAME (oldstr.c_str(), newstr.c_str()) != 0) {
- return 1;
+ if (Glib::file_test (oldstr, Glib::FILE_TEST_EXISTS)) {
+ newstr = Glib::build_filename (newpath, legal_name) + history_suffix;
+
+ cerr << "Rename " << oldstr << " => " << newstr << endl;
+
+ if (RENAME (oldstr.c_str(), newstr.c_str()) != 0) {
+ return 1;
+ }
}
_path = newpath;