don't try (and fail) to rename the history file if it doesn't exist
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 18 Jul 2011 15:04:00 +0000 (15:04 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 18 Jul 2011 15:04:00 +0000 (15:04 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@9892 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/session_state.cc

index c8323047ebc05829baa361fa57aae6820bbbeb7f..0973e294c5f5c438797d45f260bd026cba9e11e5 100644 (file)
@@ -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;