diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-05-11 18:36:04 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-06-29 14:18:12 -0400 |
commit | d98bf248ad4a0ec151f1fb37d09182d287298052 (patch) | |
tree | 2cafa36143b4700419cdea85304e60aff5827729 /libs/ardour/find_session.cc | |
parent | f6149dffa3a7ad6b7d4e456f01b6269ddfc73f43 (diff) |
more reliable check for session files, to cover *.ardour.bak cases, and exclude them
Diffstat (limited to 'libs/ardour/find_session.cc')
-rw-r--r-- | libs/ardour/find_session.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/ardour/find_session.cc b/libs/ardour/find_session.cc index 501927c42c..67aa43d071 100644 --- a/libs/ardour/find_session.cc +++ b/libs/ardour/find_session.cc @@ -117,7 +117,10 @@ find_session (string str, string& path, string& snapshot, bool& isnew) suffix = snapshot.find (statefile_suffix); - if (suffix == string::npos) { + const string::size_type start_pos_of_extension = snapshot.size () - strlen (statefile_suffix); + // we should check the start of extension position + // because files '*.ardour.bak' are possible + if (suffix != start_pos_of_extension) { error << string_compose (_("%1 is not a snapshot file"), str) << endmsg; return -1; } |