Fix testing for session files

The clause that was added in b65fe35f67 to allow passing
FQN including .ardour suffix on the comandline.

As side-effect this prevented loading sessions that were named
after a folder inside the session-bundle. e.g. "plugin" or
"interchage" or "dead" etc.
This commit is contained in:
Robin Gareus 2025-11-18 04:41:55 +01:00
parent 3361d073d3
commit a56b4e5aeb
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -983,7 +983,7 @@ Session::load_state (string snapshot_name, bool from_template)
std::string xmlpath(_session_dir->root_path());
xmlpath = Glib::build_filename (xmlpath, legalize_for_path (snapshot_name + pending_suffix));
if (Glib::file_test (xmlpath, Glib::FILE_TEST_EXISTS)) {
if (Glib::file_test (xmlpath, Glib::FILE_TEST_IS_REGULAR)) {
/* there is pending state from a crashed capture attempt */
@ -999,9 +999,9 @@ Session::load_state (string snapshot_name, bool from_template)
xmlpath = Glib::build_filename (_session_dir->root_path(), snapshot_name);
}
if (!Glib::file_test (xmlpath, Glib::FILE_TEST_EXISTS)) {
if (!Glib::file_test (xmlpath, Glib::FILE_TEST_IS_REGULAR)) {
xmlpath = Glib::build_filename (_session_dir->root_path(), legalize_for_path (snapshot_name + statefile_suffix));
if (!Glib::file_test (xmlpath, Glib::FILE_TEST_EXISTS)) {
if (!Glib::file_test (xmlpath, Glib::FILE_TEST_IS_REGULAR)) {
error << string_compose(_("%1: session file \"%2\" doesn't exist!"), _name, xmlpath) << endmsg;
return 1;
}