From 13ef3850562711c12044a4d85274c7945f35a44a Mon Sep 17 00:00:00 2001 From: nemu Date: Fri, 13 Nov 2009 12:01:09 +0000 Subject: [PATCH] changed WKMFULLDATAPATH to MUSRFULLDATAPATH --- src/classes/PRunDataHandler.cpp | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/classes/PRunDataHandler.cpp b/src/classes/PRunDataHandler.cpp index 92c5833a..b5deba8b 100644 --- a/src/classes/PRunDataHandler.cpp +++ b/src/classes/PRunDataHandler.cpp @@ -322,11 +322,11 @@ Bool_t PRunDataHandler::FileExistsCheck(PMsrRunBlock &runInfo, const UInt_t idx) } } - // check if the file is found in the directories given by WKMFULLDATAPATH - const Char_t *wkmpath = gSystem->Getenv("WKMFULLDATAPATH"); + // check if the file is found in the directories given by MUSRFULLDATAPATH + const Char_t *musrpath = gSystem->Getenv("MUSRFULLDATAPATH"); if (pathName.CompareTo("???") == 0) { // not found in local directory and xml path - str = TString(wkmpath); - // WKMFULLDATAPATH has the structure: path_1:path_2:...:path_n + str = TString(musrpath); + // MUSRFULLDATAPATH has the structure: path_1:path_2:...:path_n TObjArray *tokens = str.Tokenize(":"); TObjString *ostr; for (Int_t i=0; iGetEntries(); i++) { @@ -337,12 +337,17 @@ Bool_t PRunDataHandler::FileExistsCheck(PMsrRunBlock &runInfo, const UInt_t idx) break; } } + // cleanup + if (tokens) { + delete tokens; + tokens = 0; + } } - // check if the file is found in the WKM generated default path - if (pathName.CompareTo("???") == 0) { // not found in WKMFULLDATAPATH search - str = TString(wkmpath); - // WKMFULLDATAPATH has the structure: path_1:path_2:...:path_n + // check if the file is found in the generated default path + if (pathName.CompareTo("???") == 0) { // not found in MUSRFULLDATAPATH search + str = TString(musrpath); + // MUSRFULLDATAPATH has the structure: path_1:path_2:...:path_n TObjArray *tokens = str.Tokenize(":"); TObjString *ostr; pstr = runInfo.GetInstitute(idx); @@ -374,6 +379,11 @@ Bool_t PRunDataHandler::FileExistsCheck(PMsrRunBlock &runInfo, const UInt_t idx) break; } } + // clean up + if (tokens) { + delete tokens; + tokens = 0; + } } // no proper path name found @@ -382,7 +392,7 @@ Bool_t PRunDataHandler::FileExistsCheck(PMsrRunBlock &runInfo, const UInt_t idx) cerr << endl << " standard search pathes are:"; cerr << endl << " 1. the local directory"; cerr << endl << " 2. the data directory given in the startup XML file"; - cerr << endl << " 3. the directories listed in WKMFULLDATAPATH"; + cerr << endl << " 3. the directories listed in MUSRFULLDATAPATH"; cerr << endl << " 4. default path construct which is described in the manual"; return false; }