From b08ea761f6e5a8f563438ef1f0d6c42af483e753 Mon Sep 17 00:00:00 2001 From: Christophe Meynard Date: Wed, 13 Nov 2024 15:06:55 +0100 Subject: [PATCH] MMVII: Fix MPatFile and RunMultiSet when only 1 file match pattern --- MMVII/src/Appli/cMMVII_Appli.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MMVII/src/Appli/cMMVII_Appli.cpp b/MMVII/src/Appli/cMMVII_Appli.cpp index b40fb4a2bb..66eab6476b 100755 --- a/MMVII/src/Appli/cMMVII_Appli.cpp +++ b/MMVII/src/Appli/cMMVII_Appli.cpp @@ -818,6 +818,11 @@ void cMMVII_Appli::InitParam(cGenArgsSpecContext *aArgsSpecs) { MMVII_UserError(eTyUEr::eEmptyPattern,"Specified set of files was empty"); } + } else if (mVMainSets.at(aNum).size() == 1){ + // If only 1 file matches the pattern, we replace the pattern in this arg by the matched file + // If RunMultiSet is called, the Appli can use this arg name to retrieve the file + // (if not doing this, arg will be the pattern (i.e ".*.tif") and the appli will fail to open that) + aVSpec.at(aK)->InitParam(UniqueStr(aNum)); } // StdOut() << "cAaaaPPlii " << __LINE__ << ToVect(mVMainSets.at(aNum)) << "\n"; }