Ignore Apple/HFS+ ._ meta-data files with statefile suffix.

Those files may otherwise show up in the Recent Session
dialog as possible states to load.
This commit is contained in:
Robin Gareus 2023-05-31 16:02:17 +02:00
parent 520b209c83
commit 193b35e885
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -3154,8 +3154,10 @@ Session::load_route_groups (const XMLNode& node, int version)
static bool
state_file_filter (const string &str, void* /*arg*/)
{
return (str.length() > strlen(statefile_suffix) &&
str.find (statefile_suffix) == (str.length() - strlen (statefile_suffix)));
return (str.length() > strlen(statefile_suffix)
&& str.find (statefile_suffix) == (str.length() - strlen (statefile_suffix))
&& str.substr (0, 2) != "._" /* ignore HFS+ extended data */
);
}
static string
@ -3876,7 +3878,6 @@ Session::cleanup_sources (CleanupReport& rep)
tmppath1 = canonical_path (spath);
tmppath2 = canonical_path ((*i));
cerr << "\t => " << tmppath2 << endl;
if (tmppath1 == tmppath2) {
used = true;
@ -3884,6 +3885,8 @@ Session::cleanup_sources (CleanupReport& rep)
}
}
cerr << "\t" << (used ? "keep: " : "drop: ") << spath << endl;
if (!used) {
unused.push_back (spath);
}