more reliable check for session files, to cover *.ardour.bak cases, and exclude them
This commit is contained in:
parent
f6149dffa3
commit
d98bf248ad
@ -117,7 +117,10 @@ find_session (string str, string& path, string& snapshot, bool& isnew)
|
|||||||
|
|
||||||
suffix = snapshot.find (statefile_suffix);
|
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;
|
error << string_compose (_("%1 is not a snapshot file"), str) << endmsg;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user