@@ -443,18 +443,17 @@ const API::Result<std::string> FileFinderImpl::findRun(const std::string &hintst
443
443
std::vector<std::string> extensionsToSearch;
444
444
extensionsToSearch.reserve (1 + extensionsProvided.size () + facilityExtensions.size ());
445
445
446
- // If extension specified in filename
447
- if (!extension.empty () && !useOnlyExtensionsProvided)
448
- extensionsToSearch.emplace_back (extension);
449
-
450
- // If no extension in filename and useExtsOnly
451
- if (extension.empty () || useOnlyExtensionsProvided) {
446
+ if (useOnlyExtensionsProvided) {
452
447
getUniqueExtensions (extensionsProvided, extensionsToSearch);
453
- }
454
- // If no extension in filename and useExtsOnly=Flase (most cases)
455
- if (extension.empty () && !useOnlyExtensionsProvided) {
456
- g_log.debug () << " Add facility extensions defined in the Facility.xml file" << std::endl;
457
- getUniqueExtensions (facilityExtensions, extensionsToSearch);
448
+
449
+ } else {
450
+ if (!extension.empty ()) {
451
+ extensionsToSearch.emplace_back (extension);
452
+
453
+ } else {
454
+ getUniqueExtensions (extensionsProvided, extensionsToSearch);
455
+ getUniqueExtensions (facilityExtensions, extensionsToSearch);
456
+ }
458
457
}
459
458
460
459
// determine which archive search facilities to use
@@ -465,9 +464,11 @@ const API::Result<std::string> FileFinderImpl::findRun(const std::string &hintst
465
464
g_log.information () << " Found path = " << path << ' \n ' ;
466
465
return path;
467
466
}
468
-
469
467
// Path not found
468
+
469
+ // If only looked for extension in filename
470
470
if (!useOnlyExtensionsProvided && extensionsToSearch.size () == 1 ) {
471
+
471
472
extensionsToSearch.pop_back (); // No need to search for missing extension again
472
473
getUniqueExtensions (extensionsProvided, extensionsToSearch);
473
474
getUniqueExtensions (facilityExtensions, extensionsToSearch);
0 commit comments