From a56b4e5aebdc90cd5e6bedf2b96dfd7826f1e924 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 18 Nov 2025 04:41:55 +0100 Subject: [PATCH] Fix testing for session files The clause that was added in b65fe35f67529 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. --- libs/ardour/session_state.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index d4e336c7dc..3da6b2d3d2 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -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; }