As the code used to be, if we are testing for a candidate filename of aaa.bbb.ccc, the call strips .ccc and matching_... strips .bbb
resulting in a match with aaa, which is not intended at all.
std::vector<string> sdirs = source_search_path (DataType::AUDIO);
vector<space_and_path>::iterator i;
uint32_t existing = 0;
- string basename = PBD::basename_nosuffix (name);
for (vector<string>::const_iterator i = sdirs.begin(); i != sdirs.end(); ++i) {
const string spath = *i;
- if (matching_unsuffixed_filename_exists_in (spath, basename)) {
+ if (matching_unsuffixed_filename_exists_in (spath, name)) {
existing++;
break;
}
break;
}
}
-
+
return (existing == 0);
}